Re: Python vs C for a mail server

2006-01-28 Thread Dan Lowe
On Jan 28, 2006, at 8:39 PM, Dennis Lee Bieber wrote: > On Sat, 28 Jan 2006 18:03:56 +1100, Steven D'Aprano said: >> >> Google is your friend. The first four mail servers listed are, in >> order: >> >> sendmail >> postfix >> Microsoft Exchange >> qmail >> > Dig a bit deeper, and exim migh

Re: newbie: working iwth list of tuples

2006-01-28 Thread Raymond Hettinger
[falcon] > I am fairly new to Python (less than a week). My goal is to write a > small prototype of a database. Rather than build it using the typical > method where one provides selection, projection, aggregation, union, > intersection, etc. functions, I would like to do it in a more > 'function

Re: newbie: working iwth list of tuples

2006-01-28 Thread Paul Rubin
"falcon" <[EMAIL PROTECTED]> writes: > I forgot to add that I passing a tuple of functions to the reduce > function but apparently that is not allowed. My guess was that a tuple > made up of individual (simple) functions might be easier to manipulate > programatically than a function which has to

Re: newbie: working iwth list of tuples

2006-01-28 Thread falcon
I forgot to add that I passing a tuple of functions to the reduce function but apparently that is not allowed. My guess was that a tuple made up of individual (simple) functions might be easier to manipulate programatically than a function which has to know the structure of a list. (My test code)

Re: newbie: working iwth list of tuples

2006-01-28 Thread Paul Rubin
"falcon" <[EMAIL PROTECTED]> writes: > I didn't find any examples of using idioms from functional programming > beyond basic explanation of reduce and map (I have a couple of Haskell > and ML books, but I know those languages even less than Python). The book you really want is SICP, http://mitpre

newbie: working iwth list of tuples

2006-01-28 Thread falcon
Hi All, I am fairly new to Python (less than a week). My goal is to write a small prototype of a database. Rather than build it using the typical method where one provides selection, projection, aggregation, union, intersection, etc. functions, I would like to do it in a more 'functional' style (

Re: Using bytecode, not code objects

2006-01-28 Thread Raymond Hettinger
[Fabiano Sidler] > I'm looking for a way to compile python source to bytecode instead of > code-objects. Is there a possibility to do that? The reason is: I want > to store pure bytecode with no additional data. > > The second question is, therefore: How can I get the correct values > for a given b

Re: Problem with odbc (pywin32) and unicode

2006-01-28 Thread Frank Millman
Diez B. Roggisch wrote: > > Unicode is one of those grey areas that I know I will have to try to > > understand one day, but I am putting off that day as long as possible! > > I suggest you better start right away instead of stumbling over it all the > time. The most problems in that field don't c

Re: SLUT distibution mangled?

2006-01-28 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Ido Yehieli" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > So I can't run SLUT on windows then? > > > Well, here's what I did (I'm running on WinXP). > > 1. Opened up slut.zip with a text editor (used

Re: Calling C++ function from python script

2006-01-28 Thread Pankaj
One small thing was incorrect there. gcc -c TestCase.c TestCase_wrap.c -I /usr/include/python2.2/ This include path is required for Python.h file -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling C++ function from python script

2006-01-28 Thread Pankaj
See, i tell u, nothing is difficult in this world. I achieved the thing which i was asking for. Thanks for the advice. I used this paper: http://www.swig.org/tutorial.html for creating python modules from C code. Which is what i needed. In order to interface both things, we need convert atleas

Re: Placing graphics & text on printed page - jan06call.jpg (0/1)

2006-01-28 Thread eric.howland
Michael Galvin wrote: > I am trying to use Python to send to the printer a calender filled > with a mix of text and simple graphics. I want to draw on the printed > page something like a table with 6 rows and 7 columns to represent a > calendar. I want to place text precisely within those boxes o

Re: Calling DLL with several data fields in output params

2006-01-28 Thread Java script Dude
>Why wouldn't you just use the target DLL that you already have? Still in the process of getting the software from the vendor. However, I have had luck in playing around with win32 api and am now getting the hang of using ctypes. Looks like I am going down the Python road. Thanks for the info :

A new French Python Book

2006-01-28 Thread Tarek Ziadé
Hello, I would like to annouce here a new book for French Python programmers: "Programmation Python" at Eyrolle's It contains, beside a syntax review and a presentation of builtins and some modules from the standard library -- yes nothing very new here, but my prompt examples are very funny--, 

Re: textvariable help

2006-01-28 Thread swisscheese
Thanks - actually I have some of those books on the way from amazon. The first couple of days with a new language are always the hardest! -- http://mail.python.org/mailman/listinfo/python-list

Re: Decoupling the version of the file from the name of the module.

2006-01-28 Thread Peter Hansen
Roy Smith wrote: > [EMAIL PROTECTED] wrote: > >>Now suppose I have make a new version with __version__ = 1.1. What >>shall I call this file and (I don't want to overwrite the old file if I >>need to go back to it)? > > Stop everything right now and get yourself some kind of version control > sys

Re: Builder Pattern

2006-01-28 Thread Alex Martelli
Jason <[EMAIL PROTECTED]> wrote: > Hi > > I really need an example of a builder pattern in python, the closest I > could find to something resembling builder was on this thread... > http://groups.google.co.uk/group/it.comp.lang.python/browse_thread/threa d/44f79c1def2583ca/200adefeefa5f3fa?lnk=st

Re: Calling DLL with several data fields in output params

2006-01-28 Thread Peter Hansen
Java script Dude wrote: > I basically need to write a script that will make calls to a DLL and > parse the return result for API calls that consist of several data > fields in the input and output parameters. > > [Questions] > [q1] Is ctypes the right Python library to use for this interaction. >

Re: ANN: SPE 0.8.2.a Python IDE: configure styles, interactive terminals & ubuntu

2006-01-28 Thread dimitri pater
Hi,From: http://www.serpia.org/spe switching to http://www.serpia.org/sorry"""please enable _javascript_ in your browser to visit serpia.orgif you think that sucks, please contact me about it if not, enable _javascript_ and click here"""If you would like to know how much people find, it sucks, thi

Re: Data Crunching and Charting....

2006-01-28 Thread Robert Kern
Mr BigSmoke wrote: > Hi Tom. > > I had more or less the same problem about 1 year and a half ago... > Since then i've tried either Matplotlib and chaco. I've started using > matplotlib but for some features reason i've decided to use only chaco. > Chaco is really cool but has some neg. points: > -

a!k ***Hot stuff - check this out !!! a!k

2006-01-28 Thread tinman4
http://www.kaneva.com/checkout/stream.aspx?assetId=2017&free=0 -- http://mail.python.org/mailman/listinfo/python-list

Using bytecode, not code objects

2006-01-28 Thread Fabiano Sidler
Hi folks! I'm looking for a way to compile python source to bytecode instead of code-objects. Is there a possibility to do that? The reason is: I want to store pure bytecode with no additional data. The second question is, therefore: How can I get the correct values for a given bytecode, such as

Re: Data Crunching and Charting....

2006-01-28 Thread [EMAIL PROTECTED]
Thanks for the response. I did look at the plot class for wxpython and that looks worth checking out too. I really just need to plot the data, optionally print, and save each as an image. Sounds like from what you've done it is alot faster than what Im doing now. Thanks again. -- http://mail.pyt

Builder Pattern

2006-01-28 Thread Jason
Hi I really need an example of a builder pattern in python, the closest I could find to something resembling builder was on this thread... http://groups.google.co.uk/group/it.comp.lang.python/browse_thread/thread/44f79c1def2583ca/200adefeefa5f3fa?lnk=st&q=design+pattern+builder+python+-build&rnum=

Re: Calling C++ function from python script

2006-01-28 Thread Ravi Teja
Right. They are complicated(Assuming that you are reading Python API docs), especially if you have not done a substantial amount of C. You spent 8 minutes trying to understand them. What did you expect? People spend days sorting out the API issues. If you are in a hurry, Pyrex is easiest approch t

Re: Data Crunching and Charting....

2006-01-28 Thread Mr BigSmoke
Hi Tom. I had more or less the same problem about 1 year and a half ago... Since then i've tried either Matplotlib and chaco. I've started using matplotlib but for some features reason i've decided to use only chaco. Chaco is really cool but has some neg. points: - documentation is not really deta

Trouble opening files

2006-01-28 Thread Westbrook, Christopher L (WESTBCL04)
I am having some trouble, and I can't figure out why. I'm trying to use the simple keylogger project from source forge, and then create a web interface to open the resulting files, so people from the outside can see the keys logged on a server. I've got the keylogger script working fine, and I ha

Re: How do I tell if I'm running in the PyWin interpreter?

2006-01-28 Thread Charles Krug
On 2006-01-28, Charles Krug <[EMAIL PROTECTED]> wrote: > On 2006-01-28, Peter Otten <[EMAIL PROTECTED]> wrote: >> Charles Krug wrote: >> >>> Is there a way to detect that I'm running the the PyWin interpreter so >>> that I can bypass its raw_input behavior? >> >> You could test >> >> if pywin_speci

Re: Decoupling the version of the file from the name of the module.

2006-01-28 Thread Roy Smith
[EMAIL PROTECTED] wrote: > Now suppose I have make a new version with __version__ = 1.1. What > shall I call this file and (I don't want to overwrite the old file if I > need to go back to it)? Stop everything right now and get yourself some kind of version control system. CVS (http://ximbiot.co

Re: Decoupling the version of the file from the name of the module.

2006-01-28 Thread Steven D'Aprano
On Sat, 28 Jan 2006 23:13:12 +0100, Xavier Morel wrote: > [EMAIL PROTECTED] wrote: >> I'm a newbie experimenting with Python. I want to incrementally develop >> a module called 'circle'. The problem is now that the file name is used >> for two purposes. To keep track of the version number and as t

Re: SLUT distibution mangled?

2006-01-28 Thread Paul McGuire
"Ido Yehieli" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > So I can't run SLUT on windows then? > Well, here's what I did (I'm running on WinXP). 1. Opened up slut.zip with a text editor (used Scite.exe), and changed all of the "/aux" references to "/bux" 2. Expanded the ZIP file.

Re: Decoupling the version of the file from the name of the module.

2006-01-28 Thread Roy Smith
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > I'm a newbie experimenting with Python. I want to incrementally develop > a module called 'circle'. The problem is now that the file name is used > for two purposes. To keep track of the version number and as the name > for the module. So

Re: Calling C++ function from python script

2006-01-28 Thread Pankaj
The examples given are too complicated. So, if it can be explained using my sample example. Would be thankful for that. /* 1.c File **/ func( char a[10] ) { int i; for( i =0; i < 10; i++) printf("\n array element is: %c", a[i]); } /* 1.py File **/ f = o

Re: Loading a Python collection from an text-file

2006-01-28 Thread Ilias Lazaridis
Ken Starks wrote: > Ilias Lazaridis wrote: > >>within a python script, I like to create a collection which I fill with >>values from an external text-file (user editable). >> >>How is this accomplished the easiest way (if possible without the need >>of libraries which are not part of the standard

Data Crunching and Charting....

2006-01-28 Thread [EMAIL PROTECTED]
Hi all. Question: I have a project nearly complete written in VB.Net using charts from 3rd party vendors...expensive, yes, fast, not really. The data I am plotting is about 30 columns by 3000-9000 rows, all in a tab delimited file(43 files total). My question is whether or not I can accomplish the

Re: Are there memory limits for external C modules?

2006-01-28 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > I was able to modify my C code so that instead of being a Python > module, it runs as a standalone binary, and it works as it should. > Calling it with os.spawn* works. The two versions are essentially the > same, the primary differences being th

Re: String Manipulation Help!

2006-01-28 Thread Paul McGuire
"Richard Schneiderman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I really enjoyed your article. I will try to understand this. > Will you be doing more of this in the future with more complicated examples? > I'm giving two presentations at PyCon at the end of February, so I thin

Re: Calling C++ function from python script

2006-01-28 Thread Ravi Teja
Extending -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling C++ function from python script

2006-01-28 Thread Pankaj
In my case, i want to use python script as parent script and call C++ function from within the python script. If this is the case, then what am i doing? 1. extending 2. embedding. ? Ravi Teja wrote: > Pankaj wrote: > > The module which i am creating is like > > > > Part A: > > 1. It does some

Re: calling python from C#...

2006-01-28 Thread Ravi Teja
Python for .NET http://www.zope.org/Members/Brian/PythonNet -- http://mail.python.org/mailman/listinfo/python-list

Re: calling python from C#...

2006-01-28 Thread Ravi Teja
I actually find Python for .NET most convenient http://www.zope.org/Members/Brian/PythonNet I did not try py2exe with these applications, so I cannot comment. -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling C++ function from python script

2006-01-28 Thread Ravi Teja
Pankaj wrote: > The module which i am creating is like > > Part A: > 1. It does some processing by using python code. > 2. The result of this python code execution is written to a text file. > [This part is already compelete]] > > Part B: > 1. I read a text file which is outputted by above python

Re: VB to Python migration

2006-01-28 Thread John M. Gabriele
Josh wrote: > We have a program written in VB6 (over 100,000 lines of code and 230 UI > screens) that we want to get out of VB and into a better language. The > program is over 10 years old and has already been ported from VB3 to > VB6, a job which took over two years. We would like to port it t

Re: Decoupling the version of the file from the name of the module.

2006-01-28 Thread Kirk McDonald
[EMAIL PROTECTED] wrote: > Now suppose I have make a new version with __version__ = 1.1. What > shall I call this file and (I don't want to overwrite the old file if I > need to go back to it) how do I import it from the shell. Your advice > sounds nice, but I would appreciate if you could give me

Re: String Manipulation Help!

2006-01-28 Thread Richard Schneiderman
I really enjoyed your article. I will try to understand this. Will you be doing more of this in the future with more complicated examples? Paul McGuire wrote: > "Dave" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> OK, I'm stumped. >> >> I'm trying to find newline characters (

Re: Decoupling the version of the file from the name of the module.

2006-01-28 Thread bobueland
Xavier Morel wrote: > Just get rid of the version number in the name (what's the point) and >define a __version__ attribute in the module, that's what is usually done. Thanks Xavier, but as I said I'm newbie and I'm not sure how to do that. Here's my module # circle.py from math import pi __ver

Python loading library containing embedded python...

2006-01-28 Thread Brennus
I have a dll/so which embeds python. I can verify it works by compiling it as an executable and adding an appropriate main. I tried to write unit tests for this library with ctypes and a simple python script. Access violations and other strange things result. I suspect this is because I am basica

Re: SLUT distibution mangled?

2006-01-28 Thread Ido Yehieli
So I can't run SLUT on windows then? -- http://mail.python.org/mailman/listinfo/python-list

Re: Decoupling the version of the file from the name of the module.

2006-01-28 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Basically I want to decouple the version of my file from the name of > the module. > > Is there a *simple* way out of this dilemma. Really, you should use a source control system. That's a program that tracks the different versions of the files in your program. When

Re: Decoupling the version of the file from the name of the module.

2006-01-28 Thread Kirk McDonald
[EMAIL PROTECTED] wrote: > I'm a newbie experimenting with Python. I want to incrementally develop > a module called 'circle'. The problem is now that the file name is used > for two purposes. To keep track of the version number and as the name > for the module. So when I develop the first version

Re: Decoupling the version of the file from the name of the module.

2006-01-28 Thread Xavier Morel
[EMAIL PROTECTED] wrote: > I'm a newbie experimenting with Python. I want to incrementally develop > a module called 'circle'. The problem is now that the file name is used > for two purposes. To keep track of the version number and as the name > for the module. So when I develop the first version

Decoupling the version of the file from the name of the module.

2006-01-28 Thread bobueland
I'm a newbie experimenting with Python. I want to incrementally develop a module called 'circle'. The problem is now that the file name is used for two purposes. To keep track of the version number and as the name for the module. So when I develop the first version of my file I have to call it circ

Re: String Manipulation Help!

2006-01-28 Thread Paul McGuire
"Dave" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > OK, I'm stumped. > > I'm trying to find newline characters (\n, specifically) that are NOT > in comments. > > So, for example (where "<-" = a newline character): > == > 1: <- > 2: /*<- > 3:

Re: - The Dynamic Opportunity - ActiveState Komodo IDE / Open Source

2006-01-28 Thread Ilias Lazaridis
[EMAIL PROTECTED] wrote: >>*Weakness* >> >> * Komodo Free Edition Not Available >> o Could have e.g. negative influence on Open-Source-Communities My apologies for the inconvenience. The corrected sentence: "Could have negative influence on image (e.g. within Open-Source-Communities

Re: User login system

2006-01-28 Thread Alex Martelli
Jorge Godoy <[EMAIL PROTECTED]> wrote: > "sophie_newbie" <[EMAIL PROTECTED]> writes: > > > Can anyone recommend an open source user login system already written > > in Python that I could use with my site? > > > > Simplicity is the most important factor, but the ability to track users > > using c

Re: String Manipulation Help!

2006-01-28 Thread Dave
This is great, thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking free disk space on Win32 ?

2006-01-28 Thread M�ta-MCI
Hi! Fun. Slow, but fun. Thanks. @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Calling C++ function from python script

2006-01-28 Thread Pankaj
The module which i am creating is like Part A: 1. It does some processing by using python code. 2. The result of this python code execution is written to a text file. [This part is already compelete]] Part B: 1. I read a text file which is outputted by above python script in a C++ program 2. and

Re: - The Dynamic Opportunity - ActiveState Komodo IDE / Open Source

2006-01-28 Thread tclguy
>*Weakness* > >* Komodo Free Edition Not Available > o Could have e.g. negative influence on Open-Source-Communities > o Reduces distribution You logic is badly flawed. -- http://mail.python.org/mailman/listinfo/python-list

Re: String Manipulation Help!

2006-01-28 Thread Kirk McDonald
Dave wrote: > OK, I'm stumped. > > I'm trying to find newline characters (\n, specifically) that are NOT > in comments. > > So, for example (where "<-" = a newline character): > == > 1: <- > 2: /*<- > 3: --<- > 4: comment<- > 5:

Re: [IDE] - The Dynamic Opportunity - ActiveState Komodo IDE / Open Source

2006-01-28 Thread Ilias Lazaridis
Scott David Daniels wrote: > Ilias Lazaridis wrote: > >> As a first step, a free personal edition (non-commercial and academic >> use) would help to spread the Komodo IDE within the communities. > > Yeah, and ActiveState makes up the loss in income on volume, eh? The personal edition costs curre

Re: MYSql, CGI web page search code not working

2006-01-28 Thread Kirk McDonald
Dennis Lee Bieber wrote: > On Sat, 28 Jan 2006 10:14:44 -0800, Kirk McDonald <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > >>The comma is intentional: the MySQLdb wants the argument(s) as a tuple. > > > The DB-API wants tuples... But my last perusal of the MySQ

String Manipulation Help!

2006-01-28 Thread Dave
OK, I'm stumped. I'm trying to find newline characters (\n, specifically) that are NOT in comments. So, for example (where "<-" = a newline character): == 1: <- 2: /*<- 3: --<- 4: comment<- 5: --<- 6: */<- 7: <- 8

Re: writing large files quickly

2006-01-28 Thread Grant Edwards
On 2006-01-28, Bengt Richter <[EMAIL PROTECTED]> wrote: >>Because it isn't really writing the zeros. You can make these >>files all day long and not run out of disk space, because this >>kind of file doesn't take very many blocks. The blocks that >>were never written are virtual blocks, inasmu

Re: textvariable help

2006-01-28 Thread James Stroud
swisscheese wrote: > Thanks for the quick reply. With your reply and another tutorial I get > it now. I needed "self.Rows = ..." in the constructor. I find myself > wasting a lot of time with poor python docs. I have found the standard library documentation amazingly well written: http://www.pyth

Re: Python vs C for a mail server

2006-01-28 Thread Grant Edwards
On 2006-01-28, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> I am a novice in python.I have to implement a full fledged mail server > > Because that's just what the world needs, yet another mail server. :) > C can be faster. And "can be" is the key. It's easy to write slow programs in C if you

Re: Checking free disk space on Win32 ?

2006-01-28 Thread [EMAIL PROTECTED]
You might find the following interesting too http://unpythonic.net/jeff/tkdu/ Cheers, Davy Mitchell Mood News - BBC News Headlines Auto-Classified as Good, Bad or Neutral. http://www.latedecember.com/sites/moodnews/ -- http://mail.python.org/mailman/listinfo/python-list

Re: VB to Python migration

2006-01-28 Thread Thomas Ganss
Josh schrieb: You haven't specified where your main pains are. Do you have at least rudimentary architecture ? How often do you have code reviews / refactored your code ? Have you been striving for good code ? Is it a total mess ? Guessing only from the number of screens, you probably have more t

Re: indentation messing up my tuple?

2006-01-28 Thread localpricemaps
sorry i left out my tuple which is at the end of my code tuple = (food + drink + "\n") data.append(tuple) f = open("froogle.sql", 'a') f.write ( ''.join( tuple ) -- http://mail.python.org/mailman/listinfo/python-list

Re: indentation messing up my tuple?

2006-01-28 Thread localpricemaps
sorry i forgot to add in the code for my tuple which is at the very end tuple = (food+ drink + "\n") data.append(tuple) f = open("froogle.sql", 'a') f.write ( ''.join( tuple ) -- http://mail.python.org/mailman/listinfo/python-list

Re: User login system

2006-01-28 Thread Jorge Godoy
"sophie_newbie" <[EMAIL PROTECTED]> writes: > Can anyone recommend an open source user login system already written > in Python that I could use with my site? > > Simplicity is the most important factor, but the ability to track users > using cookies would be helpful. > > Hopefully somebody knows

User login system

2006-01-28 Thread sophie_newbie
Can anyone recommend an open source user login system already written in Python that I could use with my site? Simplicity is the most important factor, but the ability to track users using cookies would be helpful. Hopefully somebody knows one? -- http://mail.python.org/mailman/listinfo/python-

Re: MYSql, CGI web page search code not working

2006-01-28 Thread Fred
Perfect again Kirk! Now I will study all this so I actually understand what is happening.. Thanks! Fred -- http://mail.python.org/mailman/listinfo/python-list

Re: MYSql, CGI web page search code not working

2006-01-28 Thread Kirk McDonald
Fred wrote: > OK one more... how would I do a "LIKE" instead of a = in this code? > > cursor.execute("Select * from phone where name=%s order by name", > (form['name'].value,)) > > Right off I think: > > cursor.execute("Select * from phone where name like %%s% order by > name", > (fo

Re: MYSql, CGI web page search code not working

2006-01-28 Thread Fred
OK one more... how would I do a "LIKE" instead of a = in this code? cursor.execute("Select * from phone where name=%s order by name", (form['name'].value,)) Right off I think: cursor.execute("Select * from phone where name like %%s% order by name", (form['name'].value,)) But it blow

Re: We have zipimport, how about dllimport?

2006-01-28 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > I may be on particularly potent crack, but I was wondering whether it > would make sense to distribute python code in DLLs so that the memory > occupied by the bytecode would be consumed only once even if there were > multiple processes using the same bytecode. Or is ther

Calling DLL with several data fields in output params

2006-01-28 Thread Java script Dude
Hi, I basically need to write a script that will make calls to a DLL and parse the return result for API calls that consist of several data fields in the input and output parameters. [Questions] [q1] Is ctypes the right Python library to use for this interaction. . . . . . I know about calldll bu

Re: MYSql, CGI web page search code not working

2006-01-28 Thread Fred
Thanks Kirk! That worked perfect! And makes perfect since now that I see it... Now that I have the main pieces working I can start expanding from here! Fred -- http://mail.python.org/mailman/listinfo/python-list

Re: writing large files quickly

2006-01-28 Thread Bengt Richter
On Fri, 27 Jan 2006 12:30:49 -0800, Donn Cave <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, > rbt <[EMAIL PROTECTED]> wrote: >> Won't work!? It's absolutely fabulous! I just need something big, quick >> and zeros work great. >> >> How the heck does that make a 400 MB file that fast

Re: Returning a value from code string

2006-01-28 Thread Kirk McDonald
Max wrote: > Kirk McDonald wrote: > >> Another kind of node (I'm still deciding >> whether to call them Codenodes or Opcodes or maybe Pynodes) is a chunk >> of code that can be asked to run itself, and which can be edited, on >> the fly, from within the website. Thus, one can both alter the >> f

Re: MYSql, CGI web page search code not working

2006-01-28 Thread Kirk McDonald
Fred wrote: > Yeah, I already tried that (except you have a , after name. > > Your code produces the same error: > > NameError: name 'name' is not defined > > I know I am close!! Just missing some small thing... > Oh, duh. I forgot something: #!/usr/local/bin/python print "Content-Type: text

Re: MYSql, CGI web page search code not working

2006-01-28 Thread Fred
Yeah, I already tried that (except you have a , after name. Your code produces the same error: NameError: name 'name' is not defined I know I am close!! Just missing some small thing... -- http://mail.python.org/mailman/listinfo/python-list

Re: MYSql, CGI web page search code not working

2006-01-28 Thread Kirk McDonald
Fred wrote: > No matter what I type in the form text box (or even if I leave it > blank) I get all the records. Try this: #!/usr/local/bin/python print "Content-Type: text/html\n" import MySQLdb import cgi db=MySQLdb.connect(host = 'localhost', db = 'phone') cursor=db.cursor() cursor.execute("Se

Re: We have zipimport, how about dllimport?

2006-01-28 Thread M�ta-MCI
ctypes ? -- http://mail.python.org/mailman/listinfo/python-list

Re: beta.python.org content

2006-01-28 Thread Scott David Daniels
Terry Hancock wrote: > On Fri, 27 Jan 2006 13:44:19 -0800 > Scott David Daniels <[EMAIL PROTECTED]> wrote: >> Paragraph 3 in "Why Python": >> and later in that paragraph, I'd change: >> ... extensions that provide compact numerical >> solutions >> to: >> ... extensions that provide c

Re: Efficient Find and Replace

2006-01-28 Thread Murali
Thanks for the replies. I always thought that Python lists were actually lists under the hood. If they are implemented as arrays of pointers things should be a lot more efficient. In particular what I thought was a Linear-time operation is actually an O(1) operation. Since python allows you to rep

Re: writing large files quickly

2006-01-28 Thread Ivan Voras
Jens Theisen wrote: > cp bigfile bigfile2 > > cat bigfile > bigfile3 > > du bigfile* > 8 bigfile2 > 1032bigfile3 > > So it's not consumings 0's. It's just doesn't store unwritten data. And I Very possibly cp "understands" sparse file and cat (doint what it's meant to do) doesn't :

Re: General Type Checks (int, str, tuple, etc.)

2006-01-28 Thread Scott David Daniels
Fabian Steiner wrote: > Hello! > > So far, I am using something like »if isinstance(var, int):« to > determine, whether var's value is an integer. Now I would like to know > if there is any better possibility to do such general checks or may a > construct with isinstance() even fail in certain

Re: writing large files quickly

2006-01-28 Thread Tim Peters
[Jens Theisen] > ... > Actually I'm not sure what this optimisation should give you anyway. The > only circumstance under which files with only zeroes are meaningful is > testing, and that's exactly when you don't want that optimisation. In most cases, a guarantee that reading "uninitialized" file

Re: Efficient Find and Replace

2006-01-28 Thread Scott David Daniels
Murali wrote: > Given: L = list of integers. X and Y are integers. > Problem: find every occurrence of X and replace with Y > Problem with both solutions is the efficiency. As everyone else says, you are hallucinating efficiency problems probably brought on by an overdose of Lisp or ML. Here

Re: Python vs C for a mail server

2006-01-28 Thread Nicolas Lehuen
Jens Theisen wrote: > Please don't be offended, but if anyone could make a point of how Python's > disadvantages in these regards could be alleviated, I'd be very > interested. > > Jens Well, I write Java, C++ and Python code, and I have posted a few thoughts about this on my blog : http://nicola

Re: Python vs C for a mail server

2006-01-28 Thread Alex Martelli
Jens Theisen <[EMAIL PROTECTED]> wrote: ... > Please don't be offended, but if anyone could make a point of how Python's > disadvantages in these regards could be alleviated, I'd be very > interested.

Re: writing large files quickly

2006-01-28 Thread Scott David Daniels
Jens Theisen wrote: > Ivan wrote: >> I read somewhere that it has a use in database software, but the only >> thing I can imagine for this is when using heap queues >> (http://python.active-venture.com/lib/node162.html). I've used this feature eons ago where the file was essentially a single large

Re: MYSql, CGI web page search code not working

2006-01-28 Thread Fred
print MySQLdb.paramstyle returns: format I found one example like this: cursor.execute('''Select * from phone where name=%s order by name''',(name)) But I get this in my Apache error log: NameError: name 'name' is not defined Like my last problem I posted, I am sure it is something very simple

Re: [IDE] - The Dynamic Opportunity - ActiveState Komodo IDE / Open Source

2006-01-28 Thread Scott David Daniels
Ilias Lazaridis wrote: > As a first step, a free personal edition (non-commercial and academic > use) would help to spread the Komodo IDE within the communities. Yeah, and ActiveState makes up the loss in income on volume, eh? I've got no problem paying for good work. -- -Scott David Daniels [EMA

Re: textvariable help

2006-01-28 Thread swisscheese
None - it was a false impression I got somehow. -- http://mail.python.org/mailman/listinfo/python-list

Re: MYSql, CGI web page search code not working

2006-01-28 Thread Diez B. Roggisch
> > db=MySQLdb.connect(host = 'localhost', db = 'phone') > cursor=db.cursor() > cursor.execute("Select * from phone where name = name order by name") You don't parametrize the query. The where-clause thus is a tautology, as the name is always the name. Do something like this: cursor.execute("

Re: VB to Python migration

2006-01-28 Thread DH
see vb2py to help the conversion http://vb2py.sourceforge.net/ or if you want to convert vb6 to vb.net instead, there are tools from microsoft and others to help with that, such as: http://www.microsoft.com/downloads/details.aspx?FamilyId=10C491A2-FC67-4509-BC10-60C5C039A272&displaylang=en or if

Curses won't update screen - Solved!

2006-01-28 Thread Casey Bralla
My problem was caused by a getch() function which paused, waiting for the character. Live and learn. For some reason, I can't get curses to refresh the screen. Can someone offer a suggestion to try to debug this? Here is my python code snippet: stdscr=curses.initscr() curses.noecho() curses.

Re: Fast generation of permutations

2006-01-28 Thread Paul Rubin
"Anton Vredegoor" <[EMAIL PROTECTED]> writes: > > def deals(): > > for i in xrange(13**5): > > cards = [(i//p) % 13 for p in (1, 13, 169, 2197, 28561)] > > yield cards > > This gives hands like [0,0,0,0,1] and [0,0,0,1,0] which are > permutations of one another.

  1   2   >