Re: Python.h

2006-06-05 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I am running python to c converter application. It throws an > error saying python.h file not found. >Can somebody plz suggest how to resolve this problem. you need the python build files. if you're using Linux, look for something named python-dev or pyt

Re: OT: unix newbie questions

2006-06-05 Thread Fredrik Lundh
Fredrik Lundh wrote: >> *24. Display recent 10 java files, (with *.java extension) , in >> descending order by time, latest to oldest time. (1) * > > >>> files = sorted(glob.glob("*.py"), key=os.path.getmtime)[-10:] > >>> files.reverse() (to display the files, use print) -- http://mail.py

Writing to a certain line?

2006-06-05 Thread Tommy B
I was wondering if there was a way to take a txt file and, while keeping most of it, replace only one line. See, I'd have a file like: Tommy 555 Bob 62 Joe 529 And I'd want to set it to be: Tommy 555 Bob 66 Joe 529 Is there any easy way to do this? -- http://mail.python.org/mailman/listinfo/p

Re: OT: unix newbie questions

2006-06-05 Thread Fredrik Lundh
Carlos Lopez wrote: > Please help i am losing my mind ... UNIX Newbee > > *23. How do you add a line to the end of an existing file "myfile" with > date stamp. (1) * >>> f = open("myfile", "a+") >>> f.write(datestamp) >>> f.close() > *24. Display recent 10 java files, (with *.java extension

Python.h

2006-06-05 Thread praveenkumar . 117
Hi, I am running python to c converter application. It throws an error saying python.h file not found. Can somebody plz suggest how to resolve this problem. Regards, Praveen Kumar -- http://mail.python.org/mailman/listinfo/python-list

Re: Again, Downloading and Displaying an Image from the Internet in Tkinter

2006-06-05 Thread Maric Michaud
Le Mardi 06 Juin 2006 03:08, Dustan a écrit : > > I should probably also mention, the only reason I downloaded the image > to a file was because I don't know of any other way to do it. I feel no > need to save the image to my hard drive. using PIL, there is something like this (untested) : (assum

Re: C# equivalent to range()

2006-06-05 Thread Fredrik Lundh
Fuzzyman wrote: > Well, this is true. Doesn't make it a *good* thing of course... :-) on the other hand, the rules for what works and doesn't on public forums have been finely tuned for many years. that's why "the rules don't apply to me" people like Lee, "Neuruss", and others get the kind of pu

Re: Reading from a file and converting it into a list of lines

2006-06-05 Thread Girish Sahani
Really sorry for that indentation thing :) I tried out the code you have given, and also the one sreeram had written. In all of these,i get the same error of this type: Error i get in Sreeram's code is: n1,_,n2,_ = line.split(',') ValueError: need more than 1 value to unpack And error i get in you

Re: How to add few pictures into one

2006-06-05 Thread Lad
> > All that I want is this: > > I download ( via Python) some pictures from internet and I want to add > > all these pictures into one =one file/ > > So far, I managed to download pictures but I do not know how to add i > > them nto one file. > > How can I do that? > > Thank you for reply and he

Re: Concatenating dictionary values and keys, and further operations

2006-06-05 Thread Gerard Flanagan
Girish Sahani wrote: > Gerard Flanagan wrote: >> Girish Sahani wrote: >> > I wrote the following code to concatenate every 2 keys of a dictionary >> and >> > their corresponding values. >> > e.g if i have tiDict1 = tiDict1 = {'a':[1,2],'b':[3,4,5]} i should get >> > tiDict2={'ab':[1,2][3,4,5]} and

using custom cookies in http

2006-06-05 Thread Astan Chee
Hi, Im attemtping to set values of custom cookies and use it to gain access to certain web-pages that require these custom cookies. What I've done so far is creating the cookies like so: import Cookie C = Cookie.SmartCookie() C["__user_name"] = "foob" And Im trying to open a url that requires

Re: Reading from a file and converting it into a list of lines: code not working

2006-06-05 Thread John Machin
On 6/06/2006 2:10 PM, Girish Sahani wrote: > I have a text file in the following format: > > 1,'a',2,'b' > 3,'a',5,'c' > 3,'a',6,'c' > 3,'a',7,'b' > 8,'a',7,'b' Check out the csv module. > . > . > . > Now i need to generate 2 things by reading the file: > 1) A dictionary with the numbers as keys

Re: the most efficient method of adding elements to the list

2006-06-05 Thread K.S.Sreeram
alf wrote: > Would it be .append()? Does it reallocate te list with each apend? No append does NOT reallocate for every call. Whenever a reallocation happens, the newsize is proportional to the older size. So you should essentially get amortized constant time for every append call. If you want to

Re: Reading from a file and converting it into a list of lines: code not working

2006-06-05 Thread K.S.Sreeram
Girish Sahani wrote: > 1) A dictionary with the numbers as keys and the letters as values. > e.g the above would give me a dictionary like > {1:'a', 2:'b', 3:'a', 5:'c', 6:'c' } def get_dict( f ) : out = {} for line in file(f) : n1,s1,n2,s2 = line.split(',') out.upd

Re: the most efficient method of adding elements to the list

2006-06-05 Thread Erik Max Francis
alf wrote: > Would it be .append()? Does it reallocate te list with each apend? > > l=[] > for i in xrange(n): > l.append(i) No, it doesn't. It expands the capacity of the list if necessary. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37

Re: the most efficient method of adding elements to the list

2006-06-05 Thread Girish Sahani
> Hi, > > Would it be .append()? Does it reallocate te list with each apend? Yes it does. If order of the new element being added doesnt matter you can use append. If it does, you can use insert(). > > l=[] > for i in xrange(n): >l.append(i) > > > Thx, A. > -- > http://mail.python.org/mailm

the most efficient method of adding elements to the list

2006-06-05 Thread alf
Hi, Would it be .append()? Does it reallocate te list with each apend? l=[] for i in xrange(n): l.append(i) Thx, A. -- http://mail.python.org/mailman/listinfo/python-list

Reading from a file and converting it into a list of lines: code not working

2006-06-05 Thread Girish Sahani
I have a text file in the following format: 1,'a',2,'b' 3,'a',5,'c' 3,'a',6,'c' 3,'a',7,'b' 8,'a',7,'b' . . . Now i need to generate 2 things by reading the file: 1) A dictionary with the numbers as keys and the letters as values. e.g the above would give me a dictionary like {1:'a', 2:'b', 3:'a',

OT: unix newbie questions

2006-06-05 Thread Carlos Lopez
Please help i am losing my mind ... UNIX Newbee   23. How do you add a line to the end of an existing file "myfile" with date stamp. (1) Ans : /home/clopez ed test.txt    $a    The last line of text.    .    w     q 24. Display recent 10 java files, (with *.java extensi

Re: Again, Downloading and Displaying an Image from the Internet in Tkinter

2006-06-05 Thread Justin Ezequiel
cannot help you with Tkinter but... save=open("image.jpg","wb") save.write(web_download.read()) save.close() perhaps this would let you open the file in Paint -- http://mail.python.org/mailman/listinfo/python-list

Re: How to generate all k-1 level substrings of a string?

2006-06-05 Thread K.S.Sreeram
Girish Sahani wrote: > I want to generate all substrings of size k-1 from a string of size k. > e.g 'abcd' should give me ['abc','abd','bcd','acd'] def get_sub_set( s ) : return [s[:i]+s[i+1:] for i in range(len(s))] >>> print get_sub_set( 'abcd' ) ['bcd', 'acd', 'abd', 'abc'] Regards Sreeram

Re: Is there a way to pass a python function ptr to a c++ method from a python script?

2006-06-05 Thread Paul McGuire
"liam_herron" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > I have a core c++ library that is exposed to python through the > boost_python framework. > I would like to write the core of a Newton's method solver in C++ and > be able to write the > functions that are evaluated to be

Re: Get EXE (made with py2exe) path directory name

2006-06-05 Thread Serge Orlov
Andrei B wrote: > I need to get absolute path name of a file that's in the same dir as > the exe, however the Current Working Directory is changed to somthing > else. > Use sys.path[0] -- http://mail.python.org/mailman/listinfo/python-list

Re: Get EXE (made with py2exe) path directory name

2006-06-05 Thread Justin Ezequiel
try, if hasattr(sys, 'frozen'): me = sys.executable else: me = sys.argv[0] -- http://mail.python.org/mailman/listinfo/python-list

Get EXE (made with py2exe) path directory name

2006-06-05 Thread Andrei B
I need to get absolute path name of a file that's in the same dir as the exe, however the Current Working Directory is changed to somthing else. I turn my script into an executable with py2exe, then I create a shortcut to the EXE on the desktop. I change the "Start In" variable of the shortcut "C:

How to generate all k-1 level substrings of a string?

2006-06-05 Thread Girish Sahani
I want to generate all substrings of size k-1 from a string of size k. e.g 'abcd' should give me ['abc','abd','bcd','acd'] Order of these strings in the list doesnt matter. Also order doesnt matter inside the string e.g 'abc' or 'bca' or 'bac' is the same. I wrote the following code but it doesnt g

Re: Expanding Search to Subfolders

2006-06-05 Thread BartlebyScrivener
>>> Could someone tell me where to learn more about directory >>> processes or show me an improved version of my first >>> script snippet? Use os.walk http://docs.python.org/lib/os-file-dir.html It takes a little reading to get it if you are a beginner, but there are zillions of examples if you

Re: check for dictionary keys

2006-06-05 Thread John Machin
On 5/06/2006 10:46 PM, Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : >> hi >> in my code, i use dict(a) to make to "a" into a dictionary , "a" comes >> from user input, so my program does not know in the first place. Then >> say , it becomes >> >> a = { '-A' : 'value1' , '-B' : "value2"

Re: Again, Downloading and Displaying an Image from the Internet in Tkinter

2006-06-05 Thread Dustan
I wrote: > Nobody answered last time. I guess they wanted me to give it a shot. > Well, here is how I download the image (it's a class method): > > def download_image(self): > web_download=self.opener.open(self.url) > save=open("image.jpg","w") > save.writelines(web_down

Is there a way to pass a python function ptr to a c++ method from a python script?

2006-06-05 Thread liam_herron
I have a core c++ library that is exposed to python through the boost_python framework. I would like to write the core of a Newton's method solver in C++ and be able to write the functions that are evaluated to be in python. Does anyone have any ideas on this? -- http://mail.python.org/mailman

Again, Downloading and Displaying an Image from the Internet in Tkinter

2006-06-05 Thread Dustan
Nobody answered last time. I guess they wanted me to give it a shot. Well, here is how I download the image (it's a class method): def download_image(self): web_download=self.opener.open(self.url) save=open("image.jpg","w") save.writelines(web_download.readlines())

Re: C# equivalent to range()

2006-06-05 Thread Neuruss
Fredrik Lundh wrote: > do you think the few of us who haven't already done so would miss > anything if we plonked you now? Oh, no... How am I supposed to live without you, Freddie? -- http://mail.python.org/mailman/listinfo/python-list

Re: PyOpenSSL and PyCrypto are outdated!

2006-06-05 Thread Mike Meng
Thank you Terry. I searched but didn't get useful information. In fact, I've built pycrypto 2.0.1 successfully. However, the source of pyOpenSSL seemed to be incompatible with lastest OpenSSL 0.98b. I tried to build it and got dozens of compile errors which complain about syntax error in x509v3.h.

Re: C# equivalent to range()

2006-06-05 Thread Scott David Daniels
Luis M. González wrote: > Fuzzyman wrote: >> FWIW I agree. If anyone didn't want to answer the question they didn't >> need to. >> >> Why be rude to someone asking a polite question. It's not as if there >> isn't much more *worse* noise on this group. > > The poster asked the question very politel

Re: Expanding Search to Subfolders

2006-06-05 Thread BartlebyScrivener
>> there are far easier ways >> #!/bin/bash >> cat *.txt >outputfile Well, yes, but if he's kicking things off with: >> os.chdir("C:\\Python23\\programs\\filetree") I'm guessing he's not on Linux. Maybe you're trying to convert him? rd -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to C converter

2006-06-05 Thread Chance Ginger
If you are looking for a "real" python to C, well in this case C++ look for the shedskin compiler. It will take a rather nice subset of Python and generate C++ code from it. It is still rather experimental but I have been using it. Chance G. On Mon, 05 Jun 2006 07:19:39 -0700, Fuzzyman wrote:

Re: Software Needs Philosophers

2006-06-05 Thread Stormcoder
He means Lisp macros. Lisp macros are nothing like the crippled C++ macros that people tend to think of. Roedy Green wrote: > On 21 May 2006 02:15:31 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote, > quoted or indirectly quoted someone who said : > > > Java has lots of macro languages, including C++'s

Re: strategy pattern and non-public virtual functions

2006-06-05 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi python experts > > In C++ I can do something like this: > class Base { > public: > void f() { this->f_(); } > private: > virtual void f_() = 0; > }; > > class Derived : public Base { > private: > void f_() { // Do something } > }; > > int main()

Re: follow-up to FieldStorage

2006-06-05 Thread Bruno Desthuilliers
John Salerno a écrit : > If I want to get all the values that are entered into an HTML form and > write them to a file, is there some way to handle them all at the same > time, or must FieldStorage be indexed by each specific field name? AFAIK, FieldStorage is a somewhat dict-like object, but I'

Re: Storing nothing in a dictionary and passing it to a function

2006-06-05 Thread Roberto Bonvallet
[EMAIL PROTECTED]: > I'd like to have a dictionary (actually a nested dictionary) to call > these functions so I can avoid if-then-elsing everything. Eath > dictionary item has three things in it: the function to be called, a > string to pass to the function (which is also the key to the dict), an

Re: C# equivalent to range()

2006-06-05 Thread Fuzzyman
Robert Kern wrote: > Fuzzyman wrote: > > Erik Max Francis wrote: > > >>Here were the "harsh" and "whining" responses to his question he's > >>complaining about: > > > > Fair enough. Maybe they weren't "harsh" and "whining", just patronising > > and abrupt. > > Welcome to USENET! Well, this is tru

Re: C# equivalent to range()

2006-06-05 Thread Robert Kern
Fuzzyman wrote: > Erik Max Francis wrote: >>Here were the "harsh" and "whining" responses to his question he's >>complaining about: > > Fair enough. Maybe they weren't "harsh" and "whining", just patronising > and abrupt. Welcome to USENET! -- Robert Kern "I have come to believe that the whol

Re: Adding attribute to objetcs

2006-06-05 Thread Bruno Desthuilliers
faulkner a écrit : (please, don't top-post - corrected) > > Miguel Galves wrote: > >>Hello, >> >>I`m starting to learn python, and I hava a very good background in Java >>and C/C++ programming. I was reading Dive into python chapter about >>OO and I saw that in python we can do the following: >>

Re: C# equivalent to range()

2006-06-05 Thread Luis M. González
Fuzzyman wrote: > FWIW I agree. If anyone didn't want to answer the question they didn't > need to. > > Why be rude to someone asking a polite question. It's not as if there > isn't much more *worse* noise on this group. I also agree. Although the question may have appeared out of place, it wasn'

Re: C# equivalent to range()

2006-06-05 Thread Fuzzyman
Erik Max Francis wrote: > Fuzzyman wrote: > > > FWIW I agree. If anyone didn't want to answer the question they didn't > > need to. > > > > Why be rude to someone asking a polite question. It's not as if there > > isn't much more *worse* noise on this group. > > Here were the "harsh" and "whining"

Re: C# equivalent to range()

2006-06-05 Thread Erik Max Francis
Neuruss wrote: > The other zilion persons who were not interested (other than the four I > mentioned above) silently and peacefully ignored the question on went > on with their happy lifes. That's because many of them have killfiled you. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.al

Re: C# equivalent to range()

2006-06-05 Thread Erik Max Francis
Fuzzyman wrote: > FWIW I agree. If anyone didn't want to answer the question they didn't > need to. > > Why be rude to someone asking a polite question. It's not as if there > isn't much more *worse* noise on this group. Here were the "harsh" and "whining" responses to his question he's complai

Re: Python + WinCE + serial port

2006-06-05 Thread Fuzzyman
pcm wrote: > Fuzzyman wrote: > > > > > pcm wrote: > >> Hi, > >> > >> Has anyone ever worked on a Python-WinCE-based program that involved > >> serial port management ? > >> > > > > Because of the size of the runtime and the fragility of the GUI > > toolkits, there has been little serious developme

Re: C# equivalent to range()

2006-06-05 Thread Fuzzyman
Neuruss wrote: > Erik Max Francis wrote: > > > I'm curious, who are "us"? > > > > The regular readers of comp.lang.python. If you don't think we haven't > > seen this a zillion times before, you're kidding yourself. > > > > If you want help on a language, ask in that language's newsgroup/mailing

Re: Little question about Tkiner: window focus

2006-06-05 Thread James Stroud
Bernard Lebel wrote: > Hello, > > I have this Tkinter window that when you click on a certain button, > another instance of Tk is created, and thus a new windows is spawned. > That second windows holds a few widgets to browse files and > directories. > > Now, as soon as I start browsing files and

Re: C# equivalent to range()

2006-06-05 Thread Erik Max Francis
Luis M. González wrote: > There are thousands of threads to choose from in this forum. > If they didn't like this question, they could have picked any other one > to discuss. > There's no need to be disagreeable :-) Plenty of people _did_ helpfully respond to his question with the right answer.

RE: C# equivalent to range()

2006-06-05 Thread Delaney, Timothy (Tim)
*Very* strong suggestion - read the following link: http://www.catb.org/~esr/faqs/smart-questions.html Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Which exceptions are recommended to me handled?

2006-06-05 Thread Delaney, Timothy (Tim)
Fredrik Lundh wrote: > Delaney, Timothy (Tim) wrote: > >> The most important problem here is that you've lost the stack trace from >> the original exception. > > which, in many cases, is a good thing, especially if you replace "int" > with a call to some low-level support library. if I call API

Re: Adding attribute to objetcs

2006-06-05 Thread faulkner
when you set an attribute of an object, python secretly calls that objects __setattr__ method. class test: def __setattr__(self, attr_name, attr_value): print self, attr_name, attr_value self.__dict__[attr_name] = attr_value# do what the original __setattr__ method does. tes

Re: xml.sax problem: getting parse() to read a string

2006-06-05 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > as mentioned in the documentation, and implied by my answer, parseString > is a helper function in the xml.sax module, not a parser method. try doing > > xml.sax.parseString(string, handler) > > instead of that make_parser/setContentHandler/parse dance. > > Thanks a

Re: ConfigParser, no attribute

2006-06-05 Thread faulkner
Settings.__init__ needs to call ConfigParser.SafeConfigParser.__init__ before it calls self.readfp. Nexu wrote: > Hello, > > I'm not sure exactly what i'm doing wrong here. I asked around on IRC > and i was told the code is correct. > The purpose of Settings() is that whenever Settings() or any of

Re: GUI Program Error

2006-06-05 Thread John Salerno
Bernard Lebel wrote: > Unless you were being sarcastic? ;-) Just temporarily dense. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: C# equivalent to range()

2006-06-05 Thread Fredrik Lundh
Neuruss wrote: > [more childish blah blah blah] do you think the few of us who haven't already done so would miss anything if we plonked you now? -- http://mail.python.org/mailman/listinfo/python-list

Re: Large Dictionaries

2006-06-05 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, Tim Peters <[EMAIL PROTECTED]> wrote: >[Jim Segrave] >> Actually, presorted lists are not a bad case for heapsort - it's quite >> immune to any existing order or lack thereof, > >Write a heapsort and time it. It's not a difference in O() behavior, >but more memory m

Re: xml.sax problem: getting parse() to read a string

2006-06-05 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I am getting the following error. > > File "acmtest.py", line 205, in parseMessage > parser.parseString(message) > AttributeError: ExpatParser instance has no attribute 'parseString' > > Am I simply missing that library here? Or am I calling it incorrectly? as me

Re: GUI Program Error

2006-06-05 Thread Bernard Lebel
On 6/5/06, John Salerno <[EMAIL PROTECTED]> wrote: > What is dir(), btw? Is it a class for creating the application? [Bernard] In your Python documentation, dir() is described in the built-in functions (section 2.1) as well as the tutorial, in the "Modules" section (chapter 6). Unless you were be

Re: GUI Program Error

2006-06-05 Thread John Salerno
John Salerno wrote: > What is dir(), btw? Is it a > class for creating the application? Heh heh, how quickly I forget about built-ins. :) Try something like this: import Tkinter as tk root = tk.Tk() label = tk.Label(root, text='Hello world!') label.pack() root.mainloop() -- http://mail.python

Re: GUI Program Error

2006-06-05 Thread John Salerno
Byte wrote: > Hi, I'm using the "Learning to Program" GUI tutorial on > http://www.freenetpages.co.uk/hp/alan.gauld/ > and am trying to write my first GUI. However, the code the tutorial > gives for starting by making a window: > > > import Tkinter > > top = Tkinter.Tk() > > dir(top) > > Does

Re: strategy pattern and non-public virtual functions

2006-06-05 Thread John J. Lee
[EMAIL PROTECTED] writes: > Hi python experts > > In C++ I can do something like this: > class Base { > public: > void f() { this->f_(); } > private: > virtual void f_() = 0; > }; > > class Derived : public Base { > private: > void f_() { // Do something } > }; > > int main()

Re: how not to run out of memory in cursor.execute

2006-06-05 Thread Jack Diederich
On Mon, Jun 05, 2006 at 07:34:05PM +0100, Steve Holden wrote: > amberite wrote: > > [EMAIL PROTECTED] wrote: > > > >>I am using cx_Oracle and MySQLdb to pull a lot of data from some tables > >>and I find that the cursor.execute method uses a lot of memory that > >>never gets garbage collected. Usi

GUI Program Error

2006-06-05 Thread Byte
Hi, I'm using the "Learning to Program" GUI tutorial on http://www.freenetpages.co.uk/hp/alan.gauld/ and am trying to write my first GUI. However, the code the tutorial gives for starting by making a window: import Tkinter top = Tkinter.Tk() dir(top) Does not work. The Python interpreter does

Re: xml.sax problem: getting parse() to read a string

2006-06-05 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > if you want to parse a string, use xml.sax.parseString instead of > xml.sax.parse. > > My function has changed to the following (parseString call instead of parse): def parseMessage(self, message): #create a XML parser parser = make_parser() #c

ConfigParser, no attribute

2006-06-05 Thread Nexu
Hello, I'm not sure exactly what i'm doing wrong here. I asked around on IRC and i was told the code is correct. The purpose of Settings() is that whenever Settings() or any of its methods are called. It should pick up the latest settings from file instead of returning what was in the buffer. This

Re: Concatenating dictionary values and keys, and further operations

2006-06-05 Thread Gerard Flanagan
Gerard Flanagan wrote: > Girish Sahani wrote: > > I wrote the following code to concatenate every 2 keys of a dictionary and > > their corresponding values. > > e.g if i have tiDict1 = tiDict1 = {'a':[1,2],'b':[3,4,5]} i should get > > tiDict2={'ab':[1,2][3,4,5]} and similarly for dicts with large

Re: urllib2 and HTTP 302

2006-06-05 Thread John J. Lee
[EMAIL PROTECTED] (John J. Lee) writes: > Laszlo Nagy <[EMAIL PROTECTED]> writes: > [...] > > how can I return the redirection URL? > > I tried to get this information from the exception but I could not. Is > > it possible to read it from the openerdirector? > > Any suggestions? > > > > > >

Re: Concatenating dictionary values and keys, and further operations

2006-06-05 Thread Gerard Flanagan
Girish Sahani wrote: > I wrote the following code to concatenate every 2 keys of a dictionary and > their corresponding values. > e.g if i have tiDict1 = tiDict1 = {'a':[1,2],'b':[3,4,5]} i should get > tiDict2={'ab':[1,2][3,4,5]} and similarly for dicts with larger no. of > features. > Now i want

Re: [twisted] PyOpenSSL and PyCrypto are outdated!

2006-06-05 Thread Terry Reedy
"Mike Meng" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I'm learning Twisted and downloaded pyOpenSSL and pycrypto win32 > installer on http://twisted.sourceforge.net/contrib/ . But I find the > lastest version are for Python 2.3. I try to rebuild pyOpenSSL from > source,

Re: How to add few pictures into one

2006-06-05 Thread Steve Holden
Lad wrote: > Steve Holden wrote: > >>Lad wrote: >> >>>K.S.Sreeram wrote: >>> >>> Lad wrote: >Hello , >is it possible to add( with PYTHON language) several image files into >one? Google for 'Python Imaging Library'... Regards Sreeram >

Re: how not to run out of memory in cursor.execute

2006-06-05 Thread Steve Holden
amberite wrote: > [EMAIL PROTECTED] wrote: > >>I am using cx_Oracle and MySQLdb to pull a lot of data from some tables >>and I find that the cursor.execute method uses a lot of memory that >>never gets garbage collected. Using fetchmany instead of fetchall does >>not seem to make any difference, s

Re: Installation Problem

2006-06-05 Thread Marshall Dudley
Fredrik Lundh wrote: Marshall Dudley wrote: > That is what I did originally, downloaded the latest version from the main > python site.  I compiled by the README file instructions, and I compiled by the > instructions on the python url which are different, but both gave identical > results, compi

Re: Large Dictionaries

2006-06-05 Thread Tim Peters
[Jim Segrave] > Actually, presorted lists are not a bad case for heapsort - it's quite > immune to any existing order or lack thereof, Write a heapsort and time it. It's not a difference in O() behavior, but more memory movement is required for a sorted list because transforming the list into a m

Re: Expanding Search to Subfolders

2006-06-05 Thread Grant Edwards
On 2006-06-05, PipedreamerGrey <[EMAIL PROTECTED]> wrote: Just in case you really are trying to accomplish something other than learn Python, there are far easier ways to do these tasks: > This is the beginning of a script that I wrote to open all the > text files in a single directory, then proc

Re: how not to run out of memory in cursor.execute

2006-06-05 Thread amberite
[EMAIL PROTECTED] wrote: > I am using cx_Oracle and MySQLdb to pull a lot of data from some tables > and I find that the cursor.execute method uses a lot of memory that > never gets garbage collected. Using fetchmany instead of fetchall does > not seem to make any difference, since it's the execut

Re: is it possible to find which process dumped core

2006-06-05 Thread Georg Brandl
Steve Holden wrote: > su wrote: >> to find which process dumped core at the promt we give >> >> $ file core.28424 >> >> core.28424: ELF 32-bit LSB core file of 'soffice.bin' (signal 11), >> Intel 80386, version 1 (SYSV), from 'soffice.bin' >> >> from this command we know 'soffice.bin' process du

Re: Expanding Search to Subfolders

2006-06-05 Thread Lou Losee
On 5 Jun 2006 10:01:06 -0700, PipedreamerGrey <[EMAIL PROTECTED]> wrote: > This is the beginning of a script that I wrote to open all the text > files in a single directory, then process the data in the text files > line by line into a single index file. > > os.chdir("C:\\Python23\\programs\\filetr

Re: Large Dictionaries

2006-06-05 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, Tim Peters <[EMAIL PROTECTED]> wrote: >[Scott David Daniels] >>> For example, time timsort (Python's internal sort) on pre-sorted >>> data; you'll find it is handled faster than random data. > >O(N) vs O(N log N), in fact. > >[Lawrence D'Oliveiro] >> But isn't that h

Re: linking errors with debug build of Python2.4.3

2006-06-05 Thread Martin Wiechert
Nonsense! I meant leaving out --enable-shared. On Sunday 04 June 2006 16:17, Martin Wiechert wrote: > You were right, leaving out --with-pydebug did the trick. > > Thanks, Martin > > On Sunday 28 May 2006 03:53, [EMAIL PROTECTED] wrote: > > Martin Wiechert wrote: > > > Hi list, > > > > > > I've cr

Re: How to add few pictures into one

2006-06-05 Thread Lad
Steve Holden wrote: > Lad wrote: > > K.S.Sreeram wrote: > > > >>Lad wrote: > >> > >>>Hello , > >>>is it possible to add( with PYTHON language) several image files into > >>>one? > >> > >>Google for 'Python Imaging Library'... > >> > >>Regards > >>Sreeram > >> > >> > >> > > > > Thank you for your

Re: re beginner

2006-06-05 Thread SuperHik
WOW! Thanks for all the answers, even those not related to regular expressions tought me some stuff I wasn't aware of. I appreciate it very much. SuperHik wrote: > hi all, > > I'm trying to understand regex for the first time, and it would be very > helpful to get an example. I have an old(er)

Re: Storing nothing in a dictionary and passing it to a function

2006-06-05 Thread Maric Michaud
Le Lundi 05 Juin 2006 19:40, Maric Michaud a écrit : > Le Lundi 05 Juin 2006 19:18, [EMAIL PROTECTED] a écrit : > > Any thoughts? > oups wanted to wirte this : In [27]: a, b = (lambda : 'works like this'), (lambda *a : a) In [28]: a(*()) Out[28]: 'works like this' In [29]: b(*()) Out[29]: () -

Re: Storing nothing in a dictionary and passing it to a function

2006-06-05 Thread Maric Michaud
Le Lundi 05 Juin 2006 19:18, [EMAIL PROTECTED] a écrit : > Any thoughts? In [24]: a, b = (lambda : 'works like this'), (lambda a, b : (a,b)) In [25]: a(*()) Out[25]: 'works like this' In [26]: b(4,3) Out[26]: (4, 3) -- _ Maric Michaud _ Aristote - www.aristote.info

Re: Storing nothing in a dictionary and passing it to a function

2006-06-05 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Hi, > > I'm writing a hand-written recursive decent parser for SPICE syntax > parsing. In one case I have one function that handles a bunch of > similar cases (you pass the name and the number of tokens you're > looking for). In another case I have a function that hand

Re: Starting New Process

2006-06-05 Thread david brochu jr
try os.spawn() using the os module -- http://mail.python.org/mailman/listinfo/python-list

Re: logging

2006-06-05 Thread Baurzhan Ismagulov
Hello Vinay, On Sun, Jun 04, 2006 at 05:23:55AM -0700, Vinay Sajip wrote: > It's not propagated to the root logger (or to ancestor loggers in > general) - just to the handlers associated with ancestor loggers. ... > You can set levels on handlers as well as loggers. So if you add a > syslog handle

Storing nothing in a dictionary and passing it to a function

2006-06-05 Thread 63q2o4i02
Hi, I'm writing a hand-written recursive decent parser for SPICE syntax parsing. In one case I have one function that handles a bunch of similar cases (you pass the name and the number of tokens you're looking for). In another case I have a function that handles a different set of tokens and so

Expanding Search to Subfolders

2006-06-05 Thread PipedreamerGrey
This is the beginning of a script that I wrote to open all the text files in a single directory, then process the data in the text files line by line into a single index file. os.chdir("C:\\Python23\\programs\\filetree") mydir = glob.glob("*.txt") index = open("index.rtf", 'w') for File in mydir

Re: reordering elements of a list

2006-06-05 Thread greenflame
Thanks all for your help! -- http://mail.python.org/mailman/listinfo/python-list

Re: xml.sax problem: getting parse() to read a string

2006-06-05 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > So in recap, it looks like it is trying to take my string argument as a > file handler. How can I get around this? if you want to parse a string, use xml.sax.parseString instead of xml.sax.parse. -- http://mail.python.org/mailman/listinfo/python-list

Re: Installation Problem

2006-06-05 Thread Fredrik Lundh
Marshall Dudley wrote: > That is what I did originally, downloaded the latest version from the main > python site. I compiled by the README file instructions, and I compiled by > the > instructions on the python url which are different, but both gave identical > results, compiles fine, runs fine

Re: Concatenating dictionary values and keys, and further operations

2006-06-05 Thread Roberto Bonvallet
Girish Sahani <[EMAIL PROTECTED]>: > I wrote the following code to concatenate every 2 keys of a dictionary and > their corresponding values. > e.g if i have tiDict1 = tiDict1 = {'a':[1,2],'b':[3,4,5]} i should get > tiDict2={'ab':[1,2][3,4,5]} and similarly for dicts with larger no. of > features.

xml.sax problem: getting parse() to read a string

2006-06-05 Thread [EMAIL PROTECTED]
Hey all, I recently came across the xml.sax libraries and am trying to use them. I am currently making a string variable, and am attempting to pass it into a parser instance as follows: def parseMessage(self, message): #create a XML parser parser = make_parser() #cre

[twisted] PyOpenSSL and PyCrypto are outdated!

2006-06-05 Thread Mike Meng
Hi all, I'm learning Twisted and downloaded pyOpenSSL and pycrypto win32 installer on http://twisted.sourceforge.net/contrib/ . But I find the lastest version are for Python 2.3. I try to rebuild pyOpenSSL from source, but get lots of compile errors. Are these two packages obsolated? Where ca

Re: strategy pattern and non-public virtual functions

2006-06-05 Thread Maric Michaud
Le Lundi 05 Juin 2006 16:07, [EMAIL PROTECTED] a écrit : > class Base { >   public: >     void f() { this->f_(); } >   private: >     virtual void f_() = 0; > }; > > class Derived : public Base { >   private: >     void f_() { // Do something } > }; > > int main() { >     Derived d; >     d.f(); >

Re: Installation Problem

2006-06-05 Thread Marshall Dudley
Fredrik Lundh wrote: > Marshall Dudley wrote: > > > Is it not possible to install the latest version of python on my FreeBSD > > system? Upgrading the FreeBSD is not an option since this is a production > > system and everything else is working fine. > > that's really a FreeBSD question, isn't it

Re: Starting New Process

2006-06-05 Thread D
Sorry to bring it back up, but is there a way to spawn the process without Twisted? -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >