PyInstaller: problem to build exe with PyQt4

2008-06-02 Thread Mark Delon
Hi, I need to generate single EXEcutable via PyInstaller. It will be genereated -> i get one single executable. AFTER CALL (exe) I get an error: "no module named _gt" Build command: 1. Configure.py 2. Makespec.py -F

ConfigObj quoting issues

2008-06-02 Thread Roopesh
Hi, I am using ConfigObj to write email addresses, as a list. I am using email module functions to extract email addresses: to_address = header.get_all('To', []) address_list = getaddresses(to_address) to = map(lambda address: '"'+address[0]+'" <'+address[1]+'>' ,address_list) conf_obj['to'] = t

Re: Merging ordered lists

2008-06-02 Thread Raymond Hettinger
> Thanks for the tip; itertools never ceases to amaze. One issue: > groupby doesn't seem to remove all duplicates, just consecutive ones > (for lists of strings and integers, at least): > > >>> [k for k, g in itertools.groupby(list("asdfdfffdf"))] > > ['a', 's', 'd', 'f', 'd', 'f', 'd', 'f'] That'

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 10:23 pm, alex23 <[EMAIL PROTECTED]> wrote: > Then again, I have no issue with the current convention and personally > find the idea of adding a "private" keyword makes as much sense as > being able to syntactically define "model", "view" and "controller" > methods. Well, the designers

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 10:23 pm, alex23 <[EMAIL PROTECTED]> wrote: > On Jun 3, 2:11 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > > > Yes, that looks interesting, but I think it has a couple of drawbacks. > > First, it requires another completely separate class for the > > "implementation" (although perhaps that c

Re: Compare 2 files and discard common lines

2008-06-02 Thread Paul McGuire
On May 29, 3:36 am, loial <[EMAIL PROTECTED]> wrote: > I have a requirement to compare 2 text files and write to a 3rd file > only those lines that appear in the 2nd file but not in the 1st file. > > Rather than re-invent the wheel I am wondering if anyone has written > anything already? Take the

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread alex23
On Jun 3, 2:11 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > Yes, that looks interesting, but I think it has a couple of drawbacks. > First, it requires another completely separate class for the > "implementation" (although perhaps that could be a nested class). That's hardly an enormous overhead, an

Re: php vs python

2008-06-02 Thread Marc 'BlackJack' Rintsch
On Mon, 02 Jun 2008 18:21:26 -0700, Joel Koltner wrote: > "Arnaud Delobelle" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> This is wrong, because if you know well one language only, you tend to >> think that the principles that underpin it are universal. So you will >> try to

Please solve me the problem

2008-06-02 Thread sagar panda
Hi I am sagar. I want to write a python script that will run the python scripts automatically from a directory. Please help me out to sovle this problem? -- with regards Mr. Sagar Panda Mob:9986142755 -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 5:11 pm, Paul Rubin wrote: > "Russ P." <[EMAIL PROTECTED]> writes: > > I also realize, by the way, that Python allows a client of a class to > > define a new class member from completely outside the class > > definition. Obviously, that cannot be declared privat

Re: Errata competion for the LaTeX Graphics Companion, Second edition --- first winner

2008-06-02 Thread thermate2
It is not difficult to predict that your book will soon be scanned and appear on the khazar site http://betah.co.il Even if does not appear there, the khazar site, namely books.google.com will get it scanned. Now what gives google the right to scan a book and store it on their computers ? Why ca

Re: Errata competion for the LaTeX Graphics Companion, Second edition --- first winner

2008-06-02 Thread thermate2
It is not difficult to predict that your book will soon be scanned and appear on the khazar site http://betah.co.il Even if does not appear there, the khazar site, namely books.google.com will get it scanned. Now what gives google the right to scan a book and store it on their computers ? Why ca

Re: Errata competion for the LaTeX Graphics Companion, Second edition --- first winner

2008-06-02 Thread thermate2
It is not difficult to predict that your book will soon be scanned and appear on the khazar site http://betah.co.il Even if does not appear there, the khazar site, namely books.google.com will get it scanned. Now what gives google the right to scan a book and store it on their computers ? Why ca

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 6:21 pm, alex23 <[EMAIL PROTECTED]> wrote: > On Jun 3, 9:41 am, "Russ P." <[EMAIL PROTECTED]> wrote: > > > Here's what I think Python should have. I think it should have a > > keyword, something like "priv," to identify data or functions as > > "private." > > As I stated earlier in this t

Re: Errata competion for the LaTeX Graphics Companion, Second edition --- first winner

2008-06-02 Thread lemnitzer
No one can win it without the basics. You have first to learn basics. I urge you to go to http://iamthewitness.com and understand the origin of the Khazars as well as listen to Mr Benjamin Freedman's speeches. I think the real winners are the KHAZARS. All others are losers. On Jun 2, 6:08 am

libgtop gtop.proc_time(pid) examples?

2008-06-02 Thread Isaac Gouy
Please show an example of using the Python libgtop wrapper to get process time information, or say where such examples can be found. -- http://mail.python.org/mailman/listinfo/python-list

Re: Ideas for master's thesis

2008-06-02 Thread Terry Reedy
"Filip Gruszczynski" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hello there, | | I am student of CS at the University of Warsaw, currently 4th year. I | am attending Object Oriented Programming seminar and it is about time, | I started looking for an idea of my master's degree

Re: mmap class has slow "in" operator

2008-06-02 Thread Gabriel Genellina
En Thu, 29 May 2008 19:17:05 -0300, Kris Kennaway <[EMAIL PROTECTED]> escribió: If I do the following: def mmap_search(f, string): fh = file(f) mm = mmap.mmap(fh.fileno(), 0, mmap.MAP_SHARED, mmap.PROT_READ) return mm.find(string) def mmap_is_in(f, string): f

Re: python blogs

2008-06-02 Thread subeen
On Jun 3, 8:43 am, Benjamin <[EMAIL PROTECTED]> wrote: > On Jun 2, 1:49 pm, [EMAIL PROTECTED] wrote: > > > Hello! > > > It seems like Python blogs are gaining popularity. It seems to me that > > they play a crucial role in promoting Python as a language. > > Do you agree with that? > > > Just a few

Re: Cast list of objects to list of strings

2008-06-02 Thread Gabriel Genellina
En Mon, 02 Jun 2008 18:56:08 -0300, jay graves <[EMAIL PROTECTED]> escribió: On Jun 2, 4:02 pm, Larry Bates <[EMAIL PROTECTED]> wrote: I think what you want is: def write_err(*args): from sys import stderr stderr.write("\n".join([str(o) for o in args])) Slight nitpick. If you are

Re: Compare 2 files and discard common lines

2008-06-02 Thread Gabriel Genellina
2008/5/29, loial <[EMAIL PROTECTED]>: I have a requirement to compare 2 text files and write to a 3rd file only those lines that appear in the 2nd file but not in the 1st file. En Thu, 29 May 2008 18:08:28 -0300, BJörn Lindqvist <[EMAIL PROTECTED]> escribió: Open('3rd','w').writelines(set(

Re: Continuous Timer

2008-06-02 Thread Gabriel Genellina
En Fri, 30 May 2008 22:50:13 -0300, Robert Dailey <[EMAIL PROTECTED]> escribió: Reading through the Python 2.5 docs, I'm seeing a Timer class in the threading module, however I cannot find a timer object that will continuously call a function of my choice every amount of milliseconds.

Re: Easy install / setuptools

2008-06-02 Thread Gabriel Genellina
En Thu, 29 May 2008 06:29:00 -0300, <[EMAIL PROTECTED]> escribió: I'm trying to figure out the "best" way to distribute my own python packages. Basicly, what I want is to have something like an "installer.exe" (on windows) which puts my package under Python/Lib/site-packages (so that it c

Re: method-wrapper?

2008-06-02 Thread Gabriel Genellina
En Sat, 31 May 2008 13:46:45 -0300, andrew cooke <[EMAIL PROTECTED]> escribió: Hi, Within Python (2.5): >>> help("__str__") Help on method-wrapper object: __str__ = class method-wrapper(object) | Methods defined here: | | __call__(...) | x.__call__(...) <==> x(...) | |

pythton 调用 so 共享库不能转换参数类型

2008-06-02 Thread windwiny
我初学python 的 ctypes, 现在的环境是 ubuntu 8.04, Python 2.5.2 (r252:60911, May 7 2008, 15:19:09) , gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7) 我创建了一个 so 共享库 - #include double myfd(double x) {return x * 2;} float myff(float x) { return x * 3;} int myfi(int x) { return x *

Re: python blogs

2008-06-02 Thread Benjamin
On Jun 2, 1:49 pm, [EMAIL PROTECTED] wrote: > Hello! > > It seems like Python blogs are gaining popularity. It seems to me that > they play a crucial role in promoting Python as a language. > Do you agree with that? > > Just a few days ago I've finished setting up a dedicated Python > blogging envi

Re: Ideas for master's thesis

2008-06-02 Thread George Sakkis
On Jun 2, 7:53 pm, "Filip Gruszczyński" <[EMAIL PROTECTED]> wrote: > Hello there, > > I am student of CS at the University of Warsaw, currently 4th year. I > am attending Object Oriented Programming seminar and it is about time, > I started looking for an idea of my master's degree project. As I l

Re: Ideas for master's thesis

2008-06-02 Thread Alan Isaac
Filip Gruszczyński wrote: I am student of CS at the University of Warsaw, currently 4th year. I am attending Object Oriented Programming seminar and it is about time, I started looking for an idea of my master's degree project. As I like Python very much, I would like to do something with this

Re: python blogs

2008-06-02 Thread pythonblogs
On Jun 2, 2:14 pm, [EMAIL PROTECTED] wrote: > On Jun 2, 2:49 pm, [EMAIL PROTECTED] wrote: > > http://www.pythonblogs.com > > It seems like Python blogs are gaining popularity. It seems to me that > > they play a crucial role in promoting Python as a language. > > Neat! Do blogs on your site have t

Re: php vs python

2008-06-02 Thread Joel Koltner
"Arnaud Delobelle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This is wrong, because if you know well one language only, you tend to > think that the principles that underpin it are universal. So you will > try to shoehorn these principles into any other language you use. Fair

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread alex23
On Jun 3, 9:41 am, "Russ P." <[EMAIL PROTECTED]> wrote: > Here's what I think Python should have. I think it should have a > keyword, something like "priv," to identify data or functions as > "private." As I stated earlier in this thread, if you want a public interface and a private implementation

Re: "Faster" I/O in a script

2008-06-02 Thread Gary Herron
[EMAIL PROTECTED] wrote: On Jun 2, 2:08 am, "kalakouentin" <[EMAIL PROTECTED]> wrote: Do you know a way to actually load my data in a more "batch-like" way so I will avoid the constant line by line reading? If your files will fit in memory, you can just do text = file.readlines() a

Re: Importing xlrd

2008-06-02 Thread John Machin
On Jun 3, 8:23 am, Chanman <[EMAIL PROTECTED]> wrote: > This is probably a simple question to most of you, but here goes. > I've downloaded the xlrd (version 0.6.1) module and placed in in the > site-packages folder. Now, when I write a script, I type: > > import sys > import xlrd > > When I run i

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Patrick Mullen
Can we plez not try and ruin my fave language with a useless concept? Strict data hiding is only necessary because textbooks say it is. Use method attributes or some other hack if you really must (people won't know it's there unless they look, and if they are looking, maybe they have a reason?) I

Re: "Faster" I/O in a script

2008-06-02 Thread miller . paul . w
On Jun 2, 2:08 am, "kalakouentin" <[EMAIL PROTECTED]> wrote: > Do you know a way to actually load my data in a more > "batch-like" way so I will avoid the constant line by line reading? If your files will fit in memory, you can just do text = file.readlines() and Python will read the entire fi

Re: Checking each item in m.group()?

2008-06-02 Thread Scott David Daniels
Gilles Ganault wrote: On Mon, 2 Jun 2008 12:06:21 -0700 (PDT), Matimus <[EMAIL PROTECTED]> wrote: Here is a brief example. Note that this code is very insecure sql = "INSERT INTO mytable (col1, col2) VALUES ('%s','%s')"%tuple( (c, "NULL")[c == ''] for c in m.groups() ) I d

Re: "Faster" I/O in a script

2008-06-02 Thread Gary Herron
kalakouentin wrote: I use python in order to analyze my data which are in a text form. The script is fairly simple. It reads a line form the input file, computes what it must compute and then write it it to a buffer/list. When the whole reading file is processed (essential all lines) then the alg

Re: Ideas for master's thesis

2008-06-02 Thread miller . paul . w
On Jun 2, 7:53 pm, "Filip Gruszczyński" <[EMAIL PROTECTED]> wrote: > I am student of CS at the University of Warsaw, currently 4th year. I > am attending Object Oriented Programming seminar and it is about time, > I started looking for an idea of my master's degree project. As I like > Python very

"Faster" I/O in a script

2008-06-02 Thread kalakouentin
I use python in order to analyze my data which are in a text form. The script is fairly simple. It reads a line form the input file, computes what it must compute and then write it it to a buffer/list. When the whole reading file is processed (essential all lines) then the algorithms goes ahead and

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Carl Banks
On Jun 2, 10:14 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2008-06-02, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > > On Jun 2, 9:07 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >> On 2008-06-02, Carl Banks <[EMAIL PROTECTED]> wrote: > > >> > On Jun 2, 6:40 am, Antoon Pardon <[EMAIL PROTE

Re: Importing xlrd

2008-06-02 Thread Gary Herron
Chanman wrote: This is probably a simple question to most of you, but here goes. I've downloaded the xlrd (version 0.6.1) module and placed in in the site-packages folder. Now, when I write a script, I type: import sys import xlrd When I run it, there is an import error saying there is no modu

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Carl Banks
On Jun 2, 7:41 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > I thought you were saying that encapsulation or so-called "data > hiding" is worthless. If I misunderstood you, then I apologize. I > don't have time to go back and sort it all out. No, not at all. I was suggesting that Antoon's example of

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Paul Rubin
"Russ P." <[EMAIL PROTECTED]> writes: > I also realize, by the way, that Python allows a client of a class to > define a new class member from completely outside the class > definition. Obviously, that cannot be declared private. This is bogus about 95% of the time though. For the cases where it

Ideas for master's thesis

2008-06-02 Thread Filip Gruszczyński
Hello there, I am student of CS at the University of Warsaw, currently 4th year. I am attending Object Oriented Programming seminar and it is about time, I started looking for an idea of my master's degree project. As I like Python very much, I would like to do something with this language, yet I

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 4:17 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Jun 2, 6:39 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > > > > > On Jun 2, 3:04 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > On Jun 2, 4:50 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > > > > > On Jun 2, 6:41 am, Carl Banks <[EMAIL PROTE

Re: Checking each item in m.group()?

2008-06-02 Thread rurpy
[EMAIL PROTECTED] wrote: > On Jun 2, 5:06 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > >> You are taking the wrong approach here. >> >> Don't build SQL statements as strings; you are enabling the next SQL >> injection attack. Pass parameters using the DB API instead. >> >> Don't use regular express

Re: Cast list of objects to list of strings

2008-06-02 Thread bukzor
On Jun 2, 2:56 pm, jay graves <[EMAIL PROTECTED]> wrote: > On Jun 2, 4:02 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > > I think what you want is: > > def write_err(*args): > > from sys import stderr > > stderr.write("\n".join([str(o) for o in args])) > > Slight nitpick. If you are usi

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Carl Banks
On Jun 2, 6:39 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > On Jun 2, 3:04 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > > On Jun 2, 4:50 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > > > > On Jun 2, 6:41 am, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > > You are not realizing that only useful(**)

Re: ANN: equivalence 0.1

2008-06-02 Thread George Sakkis
On Mon, Jun 2, 2008 at 6:31 AM, Giuseppe Ottaviano <[EMAIL PROTECTED]> wrote: > > On Jun 1, 2008, at 6:16 PM, George Sakkis wrote: > >> Equivalence is a class that can be used to maintain a partition of >> objects into equivalence sets, making sure that the equivalence >> properties (reflexivity, s

Re: Merging ordered lists

2008-06-02 Thread etal
On Jun 1, 12:34 am, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > I would do it two steps.  There's a number of ways to merge depending > on whether everything is pulled into memory or > not:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491285http://aspn.activestate.com/ASPN/Cookboo

Re: Checking each item in m.group()?

2008-06-02 Thread Gilles Ganault
On Mon, 2 Jun 2008 12:06:21 -0700 (PDT), Matimus <[EMAIL PROTECTED]> wrote: >Here is a brief example. Note that this code is very insecure and >susceptible to a SQL injection attack. Hopefully these csv files are >from a trusted source. Yes they are, and this script will only run on my PC, so it d

Re: Code correctness, and testing strategies

2008-06-02 Thread Jacob Hallen
In article <[EMAIL PROTECTED]>, David <[EMAIL PROTECTED]> wrote: >> Clients generally require *working* software. Unfortunately it is all too >> easy to ship something broken because then you can claim you completed the >> coding on time and any slippage gets lost in the next 5 years of >> mainten

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 3:04 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Jun 2, 4:50 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > > > On Jun 2, 6:41 am, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > You are not realizing that only useful(**) thing about data hiding is > > > that some code has access to the data

Re: Better performance

2008-06-02 Thread David
On Mon, Jun 2, 2008 at 4:42 AM, Franck Y <[EMAIL PROTECTED]> wrote: > Hello Folks, > > I am facing a problem where i need to parse around 200 files, i have a > bit of knowledge in PHP/Perl/Python (the magic P :-P) > Trite answer: Use whatever is going to work best in your circumstances. All 3 lan

Re: Cast list of objects to list of strings

2008-06-02 Thread Gary Herron
bukzor wrote: I have this function: def write_err(obj): from sys import stderr stderr.write(str(obj)+"\n") and I'd like to rewrite it to take a variable number of objects. Something like this: def write_err(*objs): from sys import stderr stderr.write(" ".join(objs)+"\n") b

Importing xlrd

2008-06-02 Thread Chanman
This is probably a simple question to most of you, but here goes. I've downloaded the xlrd (version 0.6.1) module and placed in in the site-packages folder. Now, when I write a script, I type: import sys import xlrd When I run it, there is an import error saying there is no module named xlrd. H

Re: Database Query Contains Old Data

2008-06-02 Thread James A. Donald
On Wed, 21 May 2008 07:23:04 -0700 (PDT), Paul Boddie > MySQL appears to use "repeatable read" by default [1] as its > transaction isolation level, whereas PostgreSQL (for example) uses > "read committed" by default [2]. I would guess that if you were using > PostgreSQL, this particular problem wo

Re: Formatting Output

2008-06-02 Thread Mensanator
On Jun 2, 2:43 pm, Doug Morse <[EMAIL PROTECTED]> wrote: > On Mon, 2 Jun 2008 12:42:12 -0700 (PDT), Mensanator <[EMAIL PROTECTED]> wrote: > >  On Jun 2, 3:38 am, Chris <[EMAIL PROTECTED]> wrote: > > > On Jun 2, 9:34 am, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > > i

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Diez B. Roggisch
Well that's nice: you're accusing me of missing the point after having quoted something I wrote as if it represented by own views, even though I footnoted it and said I was only doing it for the sake of argument. Perhaps, outside this discussion, I am totally getting "the point". I can't tell,

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Carl Banks
On Jun 2, 4:50 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > On Jun 2, 6:41 am, Carl Banks <[EMAIL PROTECTED]> wrote: > > > You are not realizing that only useful(**) thing about data hiding is > > that some code has access to the data, other code does not. If you > > "hide" data equally from everyon

Re: Merging ordered lists

2008-06-02 Thread etal
On Jun 1, 1:49 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Peter Otten wrote: > > #untested > > Already found two major blunders :( > > # still untested > import difflib > > def _merge(a, b): >     sm = difflib.SequenceMatcher(None, a, b) >     for op, a1, a2, b1, b2 in sm.get_opcodes(): >  

Re: Cast list of objects to list of strings

2008-06-02 Thread jay graves
On Jun 2, 4:02 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > I think what you want is: > def write_err(*args): > from sys import stderr > stderr.write("\n".join([str(o) for o in args])) Slight nitpick. If you are using version >= 2.4 you could use a generator expression instead of a list

Re: php vs python

2008-06-02 Thread Patrick Mullen
Yeah I would agree that a decent (a few steps below good in my book) programmer should be able to have a decent handle on a new language, given some acclimatization time of course. The amount of time this period lasts varies on the language said programmer is learning, as well as the languages he

Re: Formatting Output

2008-06-02 Thread Chris
On Jun 2, 11:34 pm, Chris <[EMAIL PROTECTED]> wrote: > On Jun 2, 9:43 pm, Doug Morse <[EMAIL PROTECTED]> wrote: > > > > > On Mon, 2 Jun 2008 12:42:12 -0700 (PDT), Mensanator <[EMAIL PROTECTED]> > > wrote: > > >  On Jun 2, 3:38 am, Chris <[EMAIL PROTECTED]> wrote: > > > > On Jun 2, 9:34 am, "[EMAIL

Re: Formatting Output

2008-06-02 Thread Chris
On Jun 2, 9:43 pm, Doug Morse <[EMAIL PROTECTED]> wrote: > On Mon, 2 Jun 2008 12:42:12 -0700 (PDT), Mensanator <[EMAIL PROTECTED]> wrote: > >  On Jun 2, 3:38 am, Chris <[EMAIL PROTECTED]> wrote: > > > On Jun 2, 9:34 am, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > > i

Re: python blogs

2008-06-02 Thread Mike Driscoll
On Jun 2, 4:14 pm, [EMAIL PROTECTED] wrote: > On Jun 2, 2:49 pm, [EMAIL PROTECTED] wrote: > > > It seems like Python blogs are gaining popularity. It seems to me that > > they play a crucial role in promoting Python as a language. > > Neat!  Do blogs on your site have to be about Python programming

Re: Checking each item in m.group()?

2008-06-02 Thread miller . paul . w
On Jun 2, 5:06 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > You are taking the wrong approach here. > > Don't build SQL statements as strings; you are enabling the next SQL > injection attack. Pass parameters using the DB API instead. > > Don't use regular expressions to parse a CSV file. Python's

Re: ThreadPoolingMixIn

2008-06-02 Thread miller . paul . w
On Jun 2, 12:41 pm, [EMAIL PROTECTED] wrote: > On Jun 2, 7:15 pm, Michael Ströder <[EMAIL PROTECTED]> wrote: > > Here are benchmarks for FreeBSD 6.2, amd64 > > packet_size         x         y >           0    499.57   1114.54 >        1024    499.29   1130.02 >        3072    500.09   1119.14 >  

Re: python blogs

2008-06-02 Thread miller . paul . w
On Jun 2, 2:49 pm, [EMAIL PROTECTED] wrote: > It seems like Python blogs are gaining popularity. It seems to me that > they play a crucial role in promoting Python as a language. Neat! Do blogs on your site have to be about Python programming, or can people blog about anything? -- http://mail.py

Re: [Re] Checking each item in m.group()?

2008-06-02 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I need to go through each line of a CSV file, and extract some fields > using a regex. Then, I need to check each retrieved field, and if it > looks like "", turn this into NULL so that it's correct SQL. You are taking the wrong approach here. Don't build SQL statement

Re: Cast list of objects to list of strings

2008-06-02 Thread Larry Bates
bukzor wrote: I have this function: def write_err(obj): from sys import stderr stderr.write(str(obj)+"\n") and I'd like to rewrite it to take a variable number of objects. Something like this: def write_err(*objs): from sys import stderr stderr.write(" ".join(objs)+"\n") b

Re: robotparser behavior on 403 (Forbidden) robot.txt files

2008-06-02 Thread Martin v. Löwis
> I just discovered that the "robotparser" module interprets > a 403 ("Forbidden") status on a "robots.txt" file as meaning > "all access disallowed". That's unexpected behavior. That's specified in the "norobots RFC": http://www.robotstxt.org/norobots-rfc.txt - On server response indicating a

Re: Writing HTML

2008-06-02 Thread miller . paul . w
On Jun 2, 3:19 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Or lxml, for that purpose, which also is a lot nicer for generating XML and > HTML in the first place. > > http://codespeak.net/lxml/ Awesome. lxml looks like exactly what I'm after... and it's in the Ubuntu repos. :-) Thanks! -- htt

Cast list of objects to list of strings

2008-06-02 Thread bukzor
I have this function: def write_err(obj): from sys import stderr stderr.write(str(obj)+"\n") and I'd like to rewrite it to take a variable number of objects. Something like this: def write_err(*objs): from sys import stderr stderr.write(" ".join(objs)+"\n") but I lose the pr

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 6:41 am, Carl Banks <[EMAIL PROTECTED]> wrote: > You are not realizing that only useful(**) thing about data hiding is > that some code has access to the data, other code does not. If you > "hide" data equally from everyone it's just a useless spelling change. I think you're missing th

Re: platypus in page header

2008-06-02 Thread Mike Driscoll
On Jun 2, 1:16 pm, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > Is it possible to use platypus in page header and footer? I need to > create a document with long paragraphs but also I need to put tables and > images in page header and multi line info in page footer with alignment etc. > > Thanks, > >  

Re: Python's doc problems: sort

2008-06-02 Thread Martin Marcher
Hi, On Wed, Apr 30, 2008 at 4:48 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > For example, in last week, that page is fetched 550 times. > The second most popular page, trails quite a distance. Here's the top yup that was me, i have access to a couple of machines and wanted to test some int

Re: ANN: equivalence 0.1

2008-06-02 Thread Giuseppe Ottaviano
On Jun 1, 2008, at 6:16 PM, George Sakkis wrote: Equivalence is a class that can be used to maintain a partition of objects into equivalence sets, making sure that the equivalence properties (reflexivity, symmetry, transitivity) are preserved. Two objects x and y are considered equivalent eithe

Re: Formatting Output

2008-06-02 Thread Doug Morse
On Mon, 2 Jun 2008 12:42:12 -0700 (PDT), Mensanator <[EMAIL PROTECTED]> wrote: > On Jun 2, 3:38 am, Chris <[EMAIL PROTECTED]> wrote: > > On Jun 2, 9:34 am, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > > i am building a little script and i want to output a series of colu

Re: Formatting Output

2008-06-02 Thread Mensanator
On Jun 2, 3:38 am, Chris <[EMAIL PROTECTED]> wrote: > On Jun 2, 9:34 am, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > Hi, > > > i am building a little script and i want to output a series of columns > > more or less like this: > > > 1  5  6 > > 2  2  8 > > 2  9  5 > > > The matter is that

Re: Writing HTML

2008-06-02 Thread Stefan Behnel
Ken Starks wrote: > [EMAIL PROTECTED] wrote: >> I've searched the standard library docs, and, while there are a couple >> options for *reading* HTML from Python, I didn't notice any for >> *writing* it. Does anyone have any recommendations (particularly ones >> not listed on PyPI)? >> >> Thanks >

Re: Checking each item in m.group()?

2008-06-02 Thread Matimus
On Jun 2, 11:42 am, "[EMAIL PROTECTED]" wrote: > Hello > > I need to go through each line of a CSV file, and extract some fields > using a regex. Then, I need to check each retrieved field, and if it > looks like "", turn this into NULL so that it's correct SQL. > > I tried a few things, but still

Re: printf in python

2008-06-02 Thread gianluca
On 2 Giu, 17:54, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 2 Jun 2008 00:32:33 -0700 (PDT), gianluca <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > Hy, I've a problem with may python library generated with swig from C > > code. I works and I can access all fun

python blogs

2008-06-02 Thread pythonblogs
Hello! It seems like Python blogs are gaining popularity. It seems to me that they play a crucial role in promoting Python as a language. Do you agree with that? Just a few days ago I've finished setting up a dedicated Python blogging environment at: http://www.pythonblogs.com Do you think it wil

[Re] Checking each item in m.group()?

2008-06-02 Thread [EMAIL PROTECTED]
Hello I need to go through each line of a CSV file, and extract some fields using a regex. Then, I need to check each retrieved field, and if it looks like "", turn this into NULL so that it's correct SQL. I tried a few things, but still can't it working: #Second field might be empty ->

Re: ValueError: unknown locale: UTF-8

2008-06-02 Thread Martin v. Löwis
> Actually, yes: > > LC_CTYPE=UTF-8 > > where is it coming from? This is basically on a clean new machine... > who might be setting it? There are many possible places. grep in your Library, as a starting point. As on Macintosh lists. > It is coming from a program elsewhere on the > system? How

Re: ThreadPoolingMixIn

2008-06-02 Thread pavel . uvarov
On Jun 2, 7:15 pm, Michael Ströder <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > To benchmark this I used a simple tcp server which writes a small > > (16k) > > string to the client and closes the connection. > > Just a general note: When benchmarking such a network service it would > b

Re: ctypes, function pointers and a lot of trouble

2008-06-02 Thread Nick Craig-Wood
Matt <[EMAIL PROTECTED]> wrote: > class MemStreamData(Structure): > _fields_ = [("mode", c_byte), >("lPos", c_uint), >("dwVisibleSize", c_uint), >("dwBufferSize", c_uint), >("cpBuffer", POINTER(c_

robotparser behavior on 403 (Forbidden) robot.txt files

2008-06-02 Thread John Nagle
I just discovered that the "robotparser" module interprets a 403 ("Forbidden") status on a "robots.txt" file as meaning "all access disallowed". That's unexpected behavior. A major site ("http://www.aplus.net/robot.txt";) has their "robots.txt" file set up that way. There's no real "robots

Re: Shed my a light :)

2008-06-02 Thread TheSaint
On 22:00, lunedì 02 giugno 2008 Paul Melis wrote: > This doesn't exactly make sense, as what you want isn't really clear... Sorry, I'm bad to express my toughts even I my nature language :) I'll give a go to getattr() and see whether the results come in my taste :) -- Mailsweeper Home : http://i

Re: mocking a logging object

2008-06-02 Thread Peter Bengtsson
On Jun 2, 12:34 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Peter Bengtsson wrote: > > In my unittest I want to override the logger of a working module so > > that it puts all logging messages in /tmp/test.log instead so that in > > my unittest I can inspect that it logs things correctly. H

Re: ThreadPoolingMixIn

2008-06-02 Thread Michael Ströder
[EMAIL PROTECTED] wrote: To benchmark this I used a simple tcp server which writes a small (16k) string to the client and closes the connection. Just a general note: When benchmarking such a network service it would be valuable to see benchmark results for several data sizes. I'd expect bette

Re: ThreadPoolingMixIn

2008-06-02 Thread pavel . uvarov
On Jun 2, 7:09 pm, [EMAIL PROTECTED] wrote: > On May 31, 9:13 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > On May 30, 2:40 pm, [EMAIL PROTECTED] wrote: > > > > Hi, everybody! > > > > I wrote a useful class ThreadPoolingMixIn which can be used to create > > > fast thread-based servers. This mi

Re: ThreadPoolingMixIn

2008-06-02 Thread pavel . uvarov
On May 31, 9:13 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On May 30, 2:40 pm, [EMAIL PROTECTED] wrote: > > > Hi, everybody! > > > I wrote a useful class ThreadPoolingMixIn which can be used to create > > fast thread-based servers. This mix-in works much faster than > > ThreadingMixIn because i

Re: php vs python

2008-06-02 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Ethan Furman <[EMAIL PROTECTED]> wrote: > Jerry Stuckle wrote: > > > > > As I've said before - good programmers can write good code in any > > language. > > > > So... an eloquent speaker of English is also an eloquent speaker of > Spanish/French/German? Oh,

Re: ctypes, function pointers and a lot of trouble

2008-06-02 Thread Matt
Hi, okay, thanks now my DLL function seems to accept the functions given, but instead of running my program keeps crashing (with windows address violation errors). I did some further investigations on that and figured out that the contextH variable is not just an identifier as I thought, but

Re: printf in python

2008-06-02 Thread gianluca
On 2 Giu, 10:08, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > gianluca <[EMAIL PROTECTED]> writes: > > Hy, I've a problem with may python library generated with swig from C > > code. I works and I can access all function but a simèple function > > that print a string don't work's. > > The function i

Greetings, fellow Pythonistas!

2008-06-02 Thread The Pythonista
Hello, all! This post is to announce a new Python-oriented blog. See my .sig for the URL. I also have a question: is there any "official" method for getting listed on Planet Python? Thanks! A fellow Pythonista -- code.py: A blog about life, the universe, and Python http://pythonista.wordp

Re: parse dates

2008-06-02 Thread Eddie Corns
brechmos <[EMAIL PROTECTED]> writes: >Hi, >I have been using PHP the last while and in particular strtotime. >What I want to replicate is finding the second or fourth Monday of the >next month. In PHP with strtotime it is easy (strtotime("second >Monday", strtotime("next month"), but I can't fin

Re: mocking a logging object

2008-06-02 Thread Peter Bengtsson
On Jun 2, 12:34 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Peter Bengtsson wrote: > > In my unittest I want to override the logger of a working module so > > that it puts all logging messages in /tmp/test.log instead so that in > > my unittest I can inspect that it logs things correctly. H

  1   2   >