Re: Why NOT only one class per file?

2007-04-06 Thread Alex Martelli
John Nagle [EMAIL PROTECTED] wrote: systems that didn't work that way, in which the program source was manipulated within the language environment, in a more structured fashion. Smalltalk, LISP, and (wierdly) Forth environments have been built that way. But it never really caught on. APL

Re: Looping issues

2007-04-06 Thread Peter Otten
Larry Bates wrote: If the files aren't terribly large (not tested): correct_lines=open(rC:\Python25\Scripts\Output \ \correct_settings.txt, r).readlines() current_lines=open(rC:\Python25\Scripts\Output\output.txt, r).readlines() for line in

Re:

2007-04-06 Thread C.L.
James Stroud jstroud at mbi.ucla.edu writes: C.L. wrote: I was looking for a function or method that would return the index to the first matching element in a list. ... ... __please don't be overly defensive__ ... The amount of typing wasted to defend design decisions such as this can

Re: Why NOT only one class per file?

2007-04-06 Thread Steven Howe
Now we're at the '_/How many Angels can dance on the head of a pin/_' question (like anything with wings would waste time dancing. Ever seen eagles mate (not the football players)? Dance it's not, but it looks like /sex on a roller coaster only better/! Get me a pair of wings!). Religious war

Re: Objects, lists and assigning values

2007-04-06 Thread Manuel Graune
Hello Gabriel, hello William, thanks to both of you for your answers. I seem to need a better book about python. Regards, Manuel Gabriel Genellina [EMAIL PROTECTED] writes: class new_class(object): def __init__(self, internal_list=None): if internal_list is None:

Freeze vs cx_Freeze

2007-04-06 Thread mathieu
Hello, I am currently investigating how to distribute a python based application on a targeted linux system (debian) and so far I only found two options: - Freeze (shipped with python dist) - cx_Freeze (*) As far as I understand those two options are very close. According to the cx_Freeze

Re: Why NOT only one class per file?

2007-04-06 Thread Paul Rubin
John Nagle [EMAIL PROTECTED] writes: Interestingly, PHP breaks this model; PHP programs are web pages. They may be on to something. See also literate programming, including the version built into Haskell. -- http://mail.python.org/mailman/listinfo/python-list

Re: Freeze vs cx_Freeze

2007-04-06 Thread Phil Thompson
On Friday 06 April 2007 9:08 am, mathieu wrote: Hello, I am currently investigating how to distribute a python based application on a targeted linux system (debian) and so far I only found two options: - Freeze (shipped with python dist) - cx_Freeze (*) As far as I understand those two

ANN: PyPE 2.8.5

2007-04-06 Thread Josiah Carlson
=== What is PyPE? === PyPE (Python Programmers' Editor) was written in order to offer a lightweight but powerful editor for those who think emacs is too much and idle is too little. Syntax highlighting is included out of the box, as is multiple open documents via tabs. Beyond the basic

Re: Objects, lists and assigning values

2007-04-06 Thread 7stud
On Apr 6, 1:23 am, Manuel Graune [EMAIL PROTECTED] wrote: Hello Gabriel, hello William, thanks to both of you for your answers. I seem to need a better book about python. What book are you reading? -- http://mail.python.org/mailman/listinfo/python-list

Python on MIPS

2007-04-06 Thread Lorenzo Mainardi
Hi everybody, I bought a very small embedded card, with a MIPS processor, running Linux. So, I would to use Python on that; I checked on python.org, but I did'nt find any release for this architecture. Could you help me? -- http://mail.python.org/mailman/listinfo/python-list

Re: RFC: Assignment as expression (pre-PEP)

2007-04-06 Thread Duncan Booth
Gabriel Genellina [EMAIL PROTECTED] wrote: You have to build the handlers list, containing (regex, handler) items; the unknown case might be a match-all expression at the end. Well, after playing a bit with decorators I got this: snip That's a nice class, and more maintainable with the

How to fix this? Sybase module and character set!!!!

2007-04-06 Thread boyeestudio
C:\python msMdbPro2.py Traceback (most recent call last): File msMdbPro2.py, line 152, in ? main() File msMdbPro2.py, line 132, in main testSyb = SybaseProc(199477,'10.130.58.154','sa','','zxdb_ecity',173624) File msMdbPro2.py, line 44, in __init__ self.sybdata =

Re: ANN: PyPE 2.8.5

2007-04-06 Thread Stef Mientki
Josiah Carlson wrote: === What is PyPE? === PyPE (Python Programmers' Editor) was written in order to offer a lightweight but powerful editor for those who think emacs is too much and idle is too little. Syntax highlighting is included out of the box, as is multiple open documents via tabs.

BaseHTTPRequestHandler reading .html with python code

2007-04-06 Thread gcmartijn
H! I was wondering how I can do something like this. file.html - bhello world/b special pythoncodetag print 'hello world' #or display str(time.localtime()[7]) /special pythoncodetag webserver.py - def do_GET(self): try: if self.path.endswith(.html):

Re: Looping issues

2007-04-06 Thread thebjorn
On Apr 5, 8:01 pm, [EMAIL PROTECTED] wrote: What I am trying to do is compare two files to each other. If the 2nd file contains the same line the first file contains, I want to print it. I wrote up the following code: correct_settings = open(C:\Python25\Scripts\Output

Re: Storing of folder structure in SQL DB

2007-04-06 Thread Sergei Minayev
Amit Khemka: On 5 Apr 2007 04:58:22 -0700, Sergei Minayev [EMAIL PROTECTED] wrote: Hi All! Can you please help me with the following problem: I need to store a copy of local folders structure in MySQL database. I have chosen the following table structure for that:

[optparse] Problem with getting an option value

2007-04-06 Thread Lucas Malor
Hello all. I'm trying to do a little script. Simply I want to make a list of all options with them default values. If the option is not specified in the command line, the script must try to read it in a config.ini file. If it's not present also there, it must set the default value. The problem

Re: Python on MIPS

2007-04-06 Thread Thomas Krüger
Lorenzo Mainardi schrieb: I bought a very small embedded card, with a MIPS processor, running Linux. So, I would to use Python on that; I checked on python.org, but I did'nt find any release for this architecture. Could you help me? How about compiling it from source? Thomas --

Re: tkinter canvas mvc

2007-04-06 Thread James Stroud
Gigs_ wrote: Hi all! I have just finished my tkinter text editor, learning tkinter purpose. Now I want to learn canvas so I want to make my paint program, I think that this will be the best to do over model-view-controler pattern which I need to learn also. Is there any good tutorial

Using os.popen3() to get binary data

2007-04-06 Thread Christoph Krammer
Hello everybody, I need to get the different frames from a GIF image in my python script and want to use the giftopnm program from netpbm to get the frames and directly convert them to pnm files. I tried to use the following code: for image in images: if (image[0:3] == 'GIF'): (si, so,

Comments in ConfigParser module

2007-04-06 Thread Joel Andres Granados
Hi list: I have run across a situation with ConfigParser Module. It refers to the comments in the configuration filed. According to the http://docs.python.org/dev/lib/module-ConfigParser.html it states that lines starting with # and ; are ignored. So lines like: ; comment # comment are

Re: [optparse] Problem with getting an option value

2007-04-06 Thread Peter Otten
Lucas Malor wrote: Hello all. I'm trying to do a little script. Simply I want to make a list of all options with them default values. If the option is not specified in the command line, the script must try to read it in a config.ini file. If it's not present also there, it must set the

Re:

2007-04-06 Thread Steve Holden
C.L. wrote: James Stroud jstroud at mbi.ucla.edu writes: C.L. wrote: I was looking for a function or method that would return the index to the first matching element in a list. ... ... __please don't be overly defensive__ ... The amount of typing wasted to defend design decisions such as

Re: About python Sybase module and the database manipulation!

2007-04-06 Thread Steve Holden
boyeestudio wrote: I write a python program which can insert one record into the Sybase databae at a time using the function fetchone(),But I find it runs slowly. So I want speed it up,But I don't know how to manipulate the database more efficiently! Thread or any other methods can do it??

Re: Using os.popen3() to get binary data

2007-04-06 Thread Thomas Krüger
Christoph Krammer schrieb: for image in images: if (image[0:3] == 'GIF'): (si, so, se) = os.popen3('giftopnm -image=all', 'b') si.write(image) frame = so.readlines() But with this code the script just hangs. When I interrupt the script, I get the following error

Getting Stack Trace on segfault

2007-04-06 Thread James Stroud
Hello All, The built-in mac osx vecLib is segfaulting in some cases--A very fun fact to find out the hard way over two nights of work. I also spent an embarrassing amount of time figuring out just where. Although I'm in quite a self-congratulatory mood right now, in the future, I feel like I

Simple mx.ODBC prob seeks simple answer

2007-04-06 Thread Greg Corradini
Hello all, I'm having trouble inserting an SQL selection into a new MS Access table. I get a parameter error on my insert statement when I try this (see below for code and error msg). I'm not sure if 'insert' or 'update' is the route I should be taking. CODE: #Import Pythond Standard Library

Re: elementary tuple question. (sorry)

2007-04-06 Thread mik3l3374
On Apr 6, 5:31 am, 7stud [EMAIL PROTECTED] wrote: On Apr 5, 3:08 pm, Steven W. Orr [EMAIL PROTECTED] wrote: I have a tuple that I got from struct.unpack. Now I want to pass the data from the returned tuple to struct.pack fmt 'l 10l 11i h 4h c 47c 0l'struct.pack(fmt, tup) Traceback

Re: Simple mx.ODBC prob seeks simple answer

2007-04-06 Thread Steve Holden
Greg Corradini wrote: Hello all, I'm having trouble inserting an SQL selection into a new MS Access table. I get a parameter error on my insert statement when I try this (see below for code and error msg). I'm not sure if 'insert' or 'update' is the route I should be taking. CODE: #Import

Re: how to remove multiple occurrences of a string within a list?

2007-04-06 Thread Steven D'Aprano
On Wed, 04 Apr 2007 15:56:34 +0200, Hendrik van Rooyen wrote: Now how would one do it and preserve the original order? This apparently simple problem is surprisingly FOS... But list comprehension to the rescue : [x for x in duplist if duplist.count(x) == 1] ['haha', 5, 6] *shakes head*

Re: tuples, index method, Python's design

2007-04-06 Thread Paul Boddie
C.L. wrote: That doesn't change the fact that this is unfriendly design. It's an ugly inconsistent chunk of a Python's past in which built-in types didn't behave like objects. It sticks out like a sore thumb, maybe just not very often. When this topic last appeared on my radar, I ended up

Re: Plugin architecture - how to do?

2007-04-06 Thread Nate Finch
On Apr 5, 10:57 am, [EMAIL PROTECTED] wrote: I'm making a program that consists of a main engine + plugins. Both are in Python. My question is, how do I go about importing arbitrary code and have it be able to use the engine's functions, classes, etc? For a true plugin architecture, you

Re: Why NOT only one class per file?

2007-04-06 Thread Steven D'Aprano
On Wed, 04 Apr 2007 14:23:19 -0700, Chris Lasher wrote: A friend of mine with a programming background in Java and Perl places each class in its own separate file in . I informed him that keeping all related classes together in a single file is more in the Python idiom than one file per

Re: Using os.popen3() to get binary data

2007-04-06 Thread Christoph Krammer
Just got the solution... After sending the image data with si.write(image), I have to close the pipe to tell the program to convert the image with si.close(). Now everything works fine. Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: low level networking in python

2007-04-06 Thread Maxim Veksler
On 4/4/07, Irmen de Jong [EMAIL PROTECTED] wrote: Maxim Veksler wrote: I'm trying to bind a non-blocking socket, here is my code: #!/usr/bin/env python import socket, select from time import sleep s_nb1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

Re: Extract zip file from email attachment

2007-04-06 Thread erikcw
On Apr 6, 12:51 am, Gabriel Genellina [EMAIL PROTECTED] wrote: erikcw wrote: resp = p.retr(msg_num) if resp[0].startswith('+OK'): You don't have to check this; errors are transformed into exceptions. fileObj = StringIO.StringIO() cStringIO is faster

How to access multiple group matches?

2007-04-06 Thread Christoph Krammer
Hello, I want to use the re module to split a data stream that consists of several blocks of data. I use the following code: iter = re.finditer('^(HEADER\n.*)+$', data) The data variable contains binary data that has the word HEADER in it in some places and binary data after this word till the

Re: Simple mx.ODBC prob seeks simple answer

2007-04-06 Thread Greg Corradini
Thanks Steve, Once again your advice solved the problem Greg Steve Holden wrote: Greg Corradini wrote: Hello all, I'm having trouble inserting an SQL selection into a new MS Access table. I get a parameter error on my insert statement when I try this (see below for code and error msg).

Re: Getting Stack Trace on segfault

2007-04-06 Thread kyosohma
On Apr 6, 7:13 am, James Stroud [EMAIL PROTECTED] wrote: Hello All, The built-in mac osx vecLib is segfaulting in some cases--A very fun fact to find out the hard way over two nights of work. I also spent an embarrassing amount of time figuring out just where. Although I'm in quite a

Re: Why NOT only one class per file?

2007-04-06 Thread Bart Willems
Steven D'Aprano wrote: On Wed, 04 Apr 2007 14:23:19 -0700, Chris Lasher wrote: A friend of mine with a programming background in Java and Perl places each class in its own separate file in . I informed him that keeping all related classes together in a single file is more in the Python

Re: SNMP agent

2007-04-06 Thread Cameron Laird
In article [EMAIL PROTECTED], alain [EMAIL PROTECTED] wrote: . . . I still find it strange that, in all these years of existence, no one felt the need for a SNMP agent in Python. Do Pythoneers only write test tools and not

Re: Python and Java

2007-04-06 Thread Ed Jensen
Steve Holden [EMAIL PROTECTED] wrote: Ed Jensen wrote: Steve Holden [EMAIL PROTECTED] wrote: Jython is an implementation of Python that compiles to Java bytecode, but at the moment there's some version lag so it won't handle the mos recent language enhancements. Probably worth a look,

Re: [optparse] Problem with getting an option value

2007-04-06 Thread Mel Wilson
Peter Otten wrote: Lucas Malor wrote: Hello all. I'm trying to do a little script. Simply I want to make a list of all options with them default values. If the option is not specified in the command line, the script must try to read it in a config.ini file. If it's not present also there,

Re: How to access multiple group matches?

2007-04-06 Thread Gary Herron
Christoph Krammer wrote: Hello, I want to use the re module to split a data stream that consists of several blocks of data. I use the following code: iter = re.finditer('^(HEADER\n.*)+$', data) The data variable contains binary data that has the word HEADER in it in some places and binary

block scope?

2007-04-06 Thread Neal Becker
One thing I sometimes miss, which is common in some other languages (c++), is idea of block scope. It would be useful to have variables that did not outlive their block, primarily to avoid name clashes. This also leads to more readable code. I wonder if this has been discussed? --

Re: Python and Java

2007-04-06 Thread Steve Holden
Ed Jensen wrote: Steve Holden [EMAIL PROTECTED] wrote: Ed Jensen wrote: Steve Holden [EMAIL PROTECTED] wrote: Jython is an implementation of Python that compiles to Java bytecode, but at the moment there's some version lag so it won't handle the mos recent language enhancements. Probably

Re: block scope?

2007-04-06 Thread Steve Holden
Neal Becker wrote: One thing I sometimes miss, which is common in some other languages (c++), is idea of block scope. It would be useful to have variables that did not outlive their block, primarily to avoid name clashes. This also leads to more readable code. I wonder if this has been

Re: Over a billion people believe Allah will provide 72 virgins to some Muslims.

2007-04-06 Thread thermate
On Apr 4, 6:31 pm, Dr. V I Plankenstein [EMAIL PROTECTED] wrote: The anthrax attack was almost certainly carried out by someone who had access to Gov labs or other secure facilities, but the attack on WTC was an act of Islamic fanaticism, and you're an ass to suggest otherwise without having

Basic Serialization - a design decision question

2007-04-06 Thread Gizmo
Hello I am a relative newcomer to Python, and I am studying it to understand its design. It intrigues me. I recently studied Serialization of classes via the pickle/cPickle library, and I have a question. Why is Serialization handled by a separate library (ie, pickle). Is it possible, by design,

Re: block scope?

2007-04-06 Thread Chris Mellon
On 4/6/07, Neal Becker [EMAIL PROTECTED] wrote: One thing I sometimes miss, which is common in some other languages (c++), is idea of block scope. It would be useful to have variables that did not outlive their block, primarily to avoid name clashes. This also leads to more readable code. I

Dr Jeff King, A Jewish MIT Engineer is the LEAD SPEAKER on 911 truth, no Islamics involved http://video.google.com/videoplay?docid=1822764959599063248

2007-04-06 Thread thermate
See the video with your own EYEBALLS, that is if you have some courage and shame left: http://video.google.com/videoplay?docid=1822764959599063248 On Apr 6, 9:39 am, [EMAIL PROTECTED] wrote: On Apr 4, 6:31 pm, Dr. V I Plankenstein [EMAIL PROTECTED] wrote: The anthrax attack was almost

Re: Newbie Question about sequence multiplication

2007-04-06 Thread Scott
Thanks to everyone that respondedI would never have figured that out. 7stud, Your suggestion is being considered lol, as there are a lot more bits of code in that book that I can't get running correctly. Any other books you'd, or anyone for that matter, would recommend as required reading?

Re: Python on MIPS

2007-04-06 Thread Lorenzo Mainardi
Thomas Krüger ha scritto: Lorenzo Mainardi schrieb: I bought a very small embedded card, with a MIPS processor, running Linux. So, I would to use Python on that; I checked on python.org, but I did'nt find any release for this architecture. Could you help me? How about compiling it from

Re: Why NOT only one class per file?

2007-04-06 Thread Greg Donald
On 4/6/07, Dennis Lee Bieber [EMAIL PROTECTED] wrote: For one liners, wouldn't ECHO the text line the.file be more appropriate? G # dd if=/dev/tty of=/dev/hda1 -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter canvas

2007-04-06 Thread Gigs_
gigs wrote: I have made drawing area and few butons. How can I make when i click my fill button that later when i click on oval oval gets filled with chousen color? when later click on my oval that is drawn in to change oval color, or to fill color in oval if click in oval with mouse --

Re: block scope?

2007-04-06 Thread Terry Reedy
Neal Becker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | One thing I sometimes miss, which is common in some other languages (c++), | is idea of block scope. It would be useful to have variables that did not | outlive their block, primarily to avoid name clashes. This also

Re: Welch essential for learning Tkinter well?

2007-04-06 Thread Russell E. Owen
In article [EMAIL PROTECTED], Kevin Walzer [EMAIL PROTECTED] wrote: James Stroud wrote: This begs the question, is anyone truly an expert in Tkinter? Frederick Lundh is, if anyone is. http://www.pythonware.com/library/tkinter/introduction/index.htm (outdated)

Re: BaseHTTPRequestHandler reading .html with python code

2007-04-06 Thread aspineux
On 6 avr, 11:52, [EMAIL PROTECTED] wrote: H! I was wondering how I can do something like this. Use a template engine like : Genshi Django/Jinja Cheetah Kid template For more engine look at http://www.turbogears.org/cogbin/ And maybe what you are looking fore is a complete framework like :

Re: Prevent Modification of Script?

2007-04-06 Thread Steven W. Orr
On Wednesday, Apr 4th 2007 at 18:04 -0700, quoth ts-dev: =Is it possible to prevent modification of a python file once its been =deployed? File permissions of the OS could be used..but that doesn't =seem very secure. = =The root of my question is verifying the integrity of the application =and

HTML Parser in python

2007-04-06 Thread [EMAIL PROTECTED]
Hi, Is there a HTML parser (not xml) in python? I need a html parser which has the ability to handle mal-format html pages. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML Parser in python

2007-04-06 Thread kyosohma
On Apr 6, 1:05 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Is there a HTML parser (not xml) in python? I need a html parser which has the ability to handle mal-format html pages. Thank you. Yeah...it's called Beautiful Soup. http://www.crummy.com/software/BeautifulSoup/ Mike --

Picture resolution and PIL

2007-04-06 Thread Johny
Is it possible to find out a picture resolution by using PIL package? Thanks for help L. -- http://mail.python.org/mailman/listinfo/python-list

Re: Picture resolution and PIL

2007-04-06 Thread kyosohma
On Apr 6, 1:16 pm, Johny [EMAIL PROTECTED] wrote: Is it possible to find out a picture resolution by using PIL package? Thanks for help L. Dunno. But I found some ways to read metadata that should give you the info in most cases: http://snippets.dzone.com/posts/show/768

Re: tuples, index method, Python's design

2007-04-06 Thread 7stud
On Apr 6, 7:56 am, Paul Boddie [EMAIL PROTECTED] wrote: The problem with 7stud's quote from GvR is that it's out of date: I would argue that it shows the very guy who invented the language stated publicly there was no good reason for tuples not to have an index method---except for consistency;

real time updating of popen, bufsize=0 problems

2007-04-06 Thread ianaré
hey all, I'm trying to get real time updates of batch file output. Here is my batch file: @echo off echo 1 @ping 127.0.0.1 -n 2 -w 1500 nul echo 2 @ping 127.0.0.1 -n 2 -w 1500 nul echo 3 If I run it in cmd.exe it will print 1, wait 15sec, print 2, wait 15sec, print 3. I tried doing it like

Re: zip files as nested modules?

2007-04-06 Thread Luciano Ramalho
Importing modules from zip files was proposed in PEP-273 [1] Here is how the spec of PEP-273 begins: ''' Currently, sys.path is a list of directory names as strings. If this PEP is implemented, an item of sys.path can be a string naming a zip file archive. ''' My interpretation of the above is

Re:

2007-04-06 Thread James Stroud
C.L. wrote: James Stroud jstroud at mbi.ucla.edu writes: C.L. wrote: I was looking for a function or method that would return the index to the first matching element in a list. ... ... __please don't be overly defensive__ ... The amount of typing wasted to defend design decisions such as

SWIG, Python, C++, and Coca-Cola

2007-04-06 Thread [EMAIL PROTECTED]
Hi Everyone, Recently I have been working on building a module for Python from C++ code, with SWIG, and towards the end of compiling the various sets of code I'm getting an error. [comp:~/swig_project] user% swig -c++ -python example.i [comp:~/swig_project] user% g++ -c example.cpp

Re: Picture resolution and PIL

2007-04-06 Thread bearophileHUGS
Johny: Is it possible to find out a picture resolution by using PIL package By Gian Mario Tagliaretti: import PIL.Image a = PIL.Image.open(foo.jpg) a.info[dpi] (72, 72) (It may raise an exception if that information isn't available) I don't know if that can be used to read the DPI tag inside a

Re: Basic Serialization - a design decision question

2007-04-06 Thread Robert Kern
Gizmo wrote: Hello I am a relative newcomer to Python, and I am studying it to understand its design. It intrigues me. I recently studied Serialization of classes via the pickle/cPickle library, and I have a question. Why is Serialization handled by a separate library (ie, pickle). Is it

Re: tuples, index method, Python's design

2007-04-06 Thread Carsten Haese
On Fri, 2007-04-06 at 11:33 -0700, 7stud wrote: On Apr 6, 7:56 am, Paul Boddie [EMAIL PROTECTED] wrote: The problem with 7stud's quote from GvR is that it's out of date: I would argue that it shows the very guy who invented the language stated publicly there was no good reason for tuples

Re: real time updating of popen, bufsize=0 problems

2007-04-06 Thread kyosohma
On Apr 6, 1:44 pm, ianaré [EMAIL PROTECTED] wrote: hey all, I'm trying to get real time updates of batch file output. Here is my batch file: @echo off echo 1 @ping 127.0.0.1 -n 2 -w 1500 nul echo 2 @ping 127.0.0.1 -n 2 -w 1500 nul echo 3 If I run it in cmd.exe it will print 1, wait

Debugging multithreaded program using Eclipse/Pydev

2007-04-06 Thread John Henry
I am back against the wall trying to migrate my multithreaded application from Python 2.3 to 2.5. The part of the code that's failing has to do with queues (2.3 queues and 2.5 queues are not the same). Since WingIDE doesn't support multithread debugging (they've been saying that one day they

Re: real time updating of popen, bufsize=0 problems

2007-04-06 Thread ianaré
On Apr 6, 3:22 pm, [EMAIL PROTECTED] wrote: On Apr 6, 1:44 pm, ianaré [EMAIL PROTECTED] wrote: hey all, I'm trying to get real time updates of batch file output. Here is my batch file: @echo off echo 1 @ping 127.0.0.1 -n 2 -w 1500 nul echo 2 @ping 127.0.0.1 -n 2 -w 1500 nul

Re: Newbie Question about sequence multiplication

2007-04-06 Thread Steve Holden
Scott wrote: [...] Now when suggesting books, keep in mind that, that while I'm new to Python (and programming in general) I'm able to grasp difficult concepts as long as I have enough detail as to why it is the way it is. For instance I'm, by experience and nature, a computer

Re: Basic Serialization - a design decision question

2007-04-06 Thread Steve Holden
Gizmo wrote: Hello I am a relative newcomer to Python, and I am studying it to understand its design. It intrigues me. I recently studied Serialization of classes via the pickle/cPickle library, and I have a question. Why is Serialization handled by a separate library (ie, pickle). Is it

Re: real time updating of popen, bufsize=0 problems

2007-04-06 Thread Rob Wolfe
ianaré [EMAIL PROTECTED] writes: hey all, I'm trying to get real time updates of batch file output. [...] So I tried subprocess: proc = subprocess.Popen('C:/path/to/test.bat', bufsize=0, stdout=subprocess.PIPE) Instead of that: for line in proc.stdout: self.display.WriteText(line)

Re: HTML Parser in python

2007-04-06 Thread eknowles
Beautiful Soup. http://www.crummy.com/software/BeautifulSoup/ Works, well...beautifully. -- http://mail.python.org/mailman/listinfo/python-list

British Marines Were tortured In Iran According to the Washington Conventions Re: Dr Jeff King, A Jewish MIT Engineer is the LEAD SPEAKER on 911 truth, no Islamics involved http://video.google.com/vid

2007-04-06 Thread stj911
We have just heard the news that the British Marines are ashamed to admit that they were tortured with Electric Wires to their Genitalia and two of them have had their penises bitten while a third ones testicles were eaten by an Iranian dog for the meal. People are now preferring the AbuGharib and

Re: real time updating of popen, bufsize=0 problems

2007-04-06 Thread ianaré
On Apr 6, 3:59 pm, Rob Wolfe [EMAIL PROTECTED] wrote: ianaré [EMAIL PROTECTED] writes: hey all, I'm trying to get real time updates of batch file output. [...] So I tried subprocess: proc = subprocess.Popen('C:/path/to/test.bat', bufsize=0, stdout=subprocess.PIPE) Instead of that:

Re: Debugging multithreaded program using Eclipse/Pydev

2007-04-06 Thread Michael Bentley
On Apr 6, 2007, at 2:32 PM, John Henry wrote: I am back against the wall trying to migrate my multithreaded application from Python 2.3 to 2.5. The part of the code that's failing has to do with queues (2.3 queues and 2.5 queues are not the same). Since WingIDE doesn't support

Database Timestamp conversion error

2007-04-06 Thread kyosohma
Hi, I am populating a mySQL database with data from the MS Access database. I have successfully figured out how to extract the data from Access, and I can insert the data successfully into mySQL with Python. My problem is that I keep hitting screwy records with what appears to be a malformed

Re: Basic Serialization - a design decision question

2007-04-06 Thread Terry Reedy
Gizmo [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Hello | I am a relative newcomer to Python, and I am studying it to understand its | design. It intrigues me. | I recently studied Serialization of classes via the pickle/cPickle library, | and I have a question. | | Why is

Re: British Marines Were tortured In Iran According to the Washington Conventions Re: Dr Jeff King, A Jewish MIT Engineer is the LEAD SPEAKER on 911 truth, no Islamics involved http://video.google.com

2007-04-06 Thread lemnitzer
On Apr 6, 1:06 pm, [EMAIL PROTECTED] wrote: We have just heard the news that the British Marines are ashamed to admit that they were tortured with Electric Wires to their Genitalia and two of them have had their penises bitten while a third ones testicles were eaten by an Iranian dog for the

Re: Debugging multithreaded program using Eclipse/Pydev

2007-04-06 Thread John Henry
On Apr 6, 1:33 pm, Michael Bentley [EMAIL PROTECTED] wrote: On Apr 6, 2007, at 2:32 PM, John Henry wrote: I am back against the wall trying to migrate my multithreaded application from Python 2.3 to 2.5. The part of the code that's failing has to do with queues (2.3 queues and 2.5 queues

Re: Database Timestamp conversion error

2007-04-06 Thread attn . steven . kuo
On Apr 6, 1:48 pm, [EMAIL PROTECTED] wrote: (snipped) If I look in the MS Access database, I see the timestamp as 5/6/112. Obviously some user didn't enter the correct date and the programmer before me didn't give Access strict enough rules to block bad dates. How do I test for a malformed

printing longs

2007-04-06 Thread garyp
Python 2.3.4 (#1, Oct 26 2004, 16:42:40) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2 x = int(8000, 16) x = x | 0x8000 stdin:1: FutureWarning: hex/oct constants sys.maxint will return positive values in Python 2.4 and up print %x % ( x ) -8000 How do I get python to

Hide the python-script from user

2007-04-06 Thread hlubenow
Hi, recently there was a thread about hiding the python-script from the user. The OP could use http://freshmeat.net/projects/pyobfuscate/ H. -- http://mail.python.org/mailman/listinfo/python-list

Re: printing longs

2007-04-06 Thread John Machin
On Apr 7, 7:54 am, garyp [EMAIL PROTECTED] wrote: Python 2.3.4 (#1, Oct 26 2004, 16:42:40) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2 x = int(8000, 16) x = x | 0x8000 stdin:1: FutureWarning: hex/oct constants sys.maxint will return positive values in Python 2.4 and up

Re: Hide the python-script from user

2007-04-06 Thread ts-dev
On Apr 6, 3:19 pm, hlubenow [EMAIL PROTECTED] wrote: recently there was a thread about hiding the python-script from the user. The OP could use Interesting - thanks -- http://mail.python.org/mailman/listinfo/python-list

Convert xml symbol notation

2007-04-06 Thread dumbkiwi
Hi, I'm working on a script to download and parse a web page, and it includes xml symbol notation, such as #39; for the ' character. Does anyone know of a pre-existing python script/lib to convert the xml notation back to the actual symbol it represents? --

Re: Hide the python-script from user

2007-04-06 Thread hlubenow
ts-dev wrote: On Apr 6, 3:19 pm, hlubenow [EMAIL PROTECTED] wrote: recently there was a thread about hiding the python-script from the user. The OP could use Interesting - thanks Well, testing it, it doesn't seem to work very well ... It seems, Python-code is rather difficult to

08 and 09 in sequence create invalid token error?!

2007-04-06 Thread IamIan
Hello all, I am confused as to why including 08 or 09 in a sequence (list or tuple) causes this error. All other numbers with a leading zero work. [01,02,03,04,05,06,07] is fine [01,02,03,04,05,06,07,10] is fine [01,02,03,04,05,06,08] produces SyntaxError: invalid token, as does:

Re: 08 and 09 in sequence create invalid token error?!

2007-04-06 Thread Wojciech Muła
IamIan wrote: I am confused as to why including 08 or 09 in a sequence (list or tuple) causes this error. All other numbers with a leading zero work. All literals that start with 0 digit are considered as octal numbers, i.e. only digits 0..7 are allowed. See octinteger lexical definition:

Re: 08 and 09 in sequence create invalid token error?!

2007-04-06 Thread IamIan
Thank you! Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: Database Timestamp conversion error

2007-04-06 Thread John Machin
On Apr 7, 6:48 am, [EMAIL PROTECTED] wrote: Hi, I am populating a mySQL database with data from the MS Access database. I have successfully figured out how to extract the data from Access, and I can insert the data successfully into mySQL with Python. My problem is that I keep hitting

Re: Indentifying the LAST occurrence of an item in a list

2007-04-06 Thread mkPyVS
On Apr 5, 6:37 pm, John Machin [EMAIL PROTECTED] wrote: help(list.index) Help on method_descriptor: index(...) L.index(value, [start, [stop]]) - integer -- return first index of value I look forward to your next version. Great point! I was assuming the temp variable space was static

Re: Comments in ConfigParser module

2007-04-06 Thread James Stroud
Joel Andres Granados wrote: Hi list: Any comment greatly appreciated Very clever. -- http://mail.python.org/mailman/listinfo/python-list

Re: Hide the python-script from user

2007-04-06 Thread hlubenow
hlubenow wrote: ts-dev wrote: On Apr 6, 3:19 pm, hlubenow [EMAIL PROTECTED] wrote: recently there was a thread about hiding the python-script from the user. The OP could use Interesting - thanks Well, testing it, it doesn't seem to work very well ... It seems, Python-code is rather

  1   2   >