Re: Windows XP unicode and escape sequences

2007-12-14 Thread Tim Roberts
<[EMAIL PROTECTED]> wrote: >I mainly work on OS X, but thought I'd experiment with some Python code on XP. > The >problem is I can't seem to get these things to work at all. > >First of all, I'd like to use Greek letters in the command prompt window, so I >was going to >use unicode to do this.

embedding filedialog in a frame in tkinter

2007-12-14 Thread [EMAIL PROTECTED]
i am trying out tkinter to make a gui..i want to have a frame with an embedded file explorer next to a 'open directory' label..i tried out FileDialog and tkFileDialog methods but they open as pop up dialogs.. how do i make this packed into the frame the way button and other widgets can be packed?

Re: opposite of zip()?

2007-12-14 Thread Steven D'Aprano
On Sat, 15 Dec 2007 06:46:44 +, Steven D'Aprano wrote: > Here's how *not* to use it to do what you want: > arrays = [[1, 2, 3, 4], [101, 102, 103, 104]] tupl = tuple("ab") map(lambda alist, x: alist.append(x), arrays, tupl) > [None, None] arrays > [[1, 2, 3, 4, 'a'], [101, 102,

Re: opposite of zip()?

2007-12-14 Thread Steven D'Aprano
On Fri, 14 Dec 2007 21:47:06 -0800, igor.tatarinov wrote: > Given a bunch of arrays, if I want to create tuples, there is > zip(arrays). What if I want to do the opposite: break a tuple up and > append the values to given arrays: >map(append, arrays, tupl) > except there is no unbound append()

Re: opposite of zip()?

2007-12-14 Thread Gary Herron
[EMAIL PROTECTED] wrote: > Given a bunch of arrays, if I want to create tuples, there is > zip(arrays). What if I want to do the opposite: break a tuple up and > append the values to given arrays: >map(append, arrays, tupl) > except there is no unbound append() (List.append() does not exist, >

Re: opposite of zip()?

2007-12-14 Thread Paddy
On Dec 15, 5:47 am, [EMAIL PROTECTED] wrote: > Given a bunch of arrays, if I want to create tuples, there is > zip(arrays). What if I want to do the opposite: break a tuple up and > append the values to given arrays: >map(append, arrays, tupl) > except there is no unbound append() (List.append(

opposite of zip()?

2007-12-14 Thread igor . tatarinov
Given a bunch of arrays, if I want to create tuples, there is zip(arrays). What if I want to do the opposite: break a tuple up and append the values to given arrays: map(append, arrays, tupl) except there is no unbound append() (List.append() does not exist, right?). Without append(), I am forc

an Invitation to be Involved in a Survey on Developing Scientific Computing Software

2007-12-14 Thread Janet93
If you are involved in the development of scientific computing software, you are invited to participate in a survey on developing this kind of software. If you have already received this request, I apologize for the cross-posting, but I am attempting to advertise to as many developers as possible.

Re: container.___le___ can use only <=?

2007-12-14 Thread Steven D'Aprano
On Fri, 14 Dec 2007 21:15:44 +, Neil Cerutti wrote: > When implementing the rich comparison operators for some sort of > container, it's tempting to save code by doing something like: > > class LarchTree: >... >def __gt__(self, other): > # A lot of code to traverse the tree >

Re: Is Python really a scripting language?

2007-12-14 Thread sturlamolden
On 15 Des, 02:59, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > oowriter --print some.doc | ps2pdf > encapsulate, encapsulate. Unfortunately, apps using inter-app > communication tend to do the opposite. That pipe is a form of IPC as well. -- http://mail.python.org/mailma

How to detect if a image file has icc profile embeded?

2007-12-14 Thread hi and hello
thx. -- http://mail.python.org/mailman/listinfo/python-list

Handling cookies without urllib2 and cookielib

2007-12-14 Thread Joshua Kugler
Standard disclaimer: read, googled, read some more. If you have a link, please free free to point me there. I'm using HTTPlib to construct some functional tests for a web app we're writing. We're not using urllib2 because we need support for PUT and DELETE methods, which urllib2 does not do. We

Re: Best way to protect my new commercial software.

2007-12-14 Thread sturlamolden
On 14 Des, 11:42, Wolfgang Draxinger <[EMAIL PROTECTED]> wrote: > > I will not make reverse engineering impossible, but it will be > > extremely difficult. > > No. It's just a matter of reading the decrypted bytecode from > memory. Ok, let med rephrase that: It may not be difficult to you. But th

Re: Connecting to SQL database

2007-12-14 Thread Gabriel Genellina
En Fri, 14 Dec 2007 23:24:24 -0300, Unknown <[EMAIL PROTECTED]> escribió: > I have successfully connected to SQL2000 and MSDEE databases in the > past, however I have to move to SQL2005 and SQLEXPRESS databases now. > Conn.ConnectionString = "Provider=SQLNCLI;Server=10.1.1.2; > Database=cs

Connecting to SQL database

2007-12-14 Thread bill ramsay
Hi I have successfully connected to SQL2000 and MSDEE databases in the past, however I have to move to SQL2005 and SQLEXPRESS databases now. I've tried the following but with no luck [this is what i used in the earlier incarnation except the Provider resource was SQLOLEDB.1] Conn = Dispatch

Re: Passing arguments to exe

2007-12-14 Thread John Machin
On Dec 15, 11:38 am, [EMAIL PROTECTED] wrote: > On Dec 14, 4:51 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > On Dec 15, 9:01 am, [EMAIL PROTECTED] wrote: > > > > I have created what amounts to a simple GUI email sending program > > > using Python + wxPython. I have modified the mailto registrat

Python - Map decode routine problem?

2007-12-14 Thread james.duckworthy
Python programmers may find the application to decoding an encrypted map image format known as Memory Map to produce a standard PNG image file interesting. Someone obviously very well versed in Python and in the intricacies of image files has written a routine to decode originally the UK Land

Python - Map decode routine problem?

2007-12-14 Thread james.duckworthy
Python programmers may find the application to decoding an encrypted map image format known as Memory Map to produce a standard PNG image file interesting. Someone obviously very well versed in Python and in the intricacies of image files has written a routine to decode originally the UK Land

Re: Is Python really a scripting language?

2007-12-14 Thread Steven D'Aprano
On Fri, 14 Dec 2007 10:26:54 -0800, John Nagle wrote: > Yes. One of the basic design flaws of UNIX was that interprocess > communication was originally almost nonexistent, and it's still not all > that great. It's easy to run other programs, and easy to send command > line parameters, but a

Python routine decodes enceypted map image format - Program problem.

2007-12-14 Thread Independent
Python programmers may find the application to decoding an encrypted map image format known as Memory Map to produce a standard PNG image file interesting. Someone obviously very well versed in Python and in the intricacies of image files has written a routine to decode originally the UK Landra

Re: state machine and a global variable

2007-12-14 Thread Steven D'Aprano
On Fri, 14 Dec 2007 23:06:28 +0100, Bruno Desthuilliers wrote: > Now the question is: why do you think it's so important for your users > to only see functions ? What's so wrong with: > > from state_machine import * > m = get_state_machine() > m.set_state(42) I can't speak for the "only" part, b

Re: Best way to protect my new commercial software.

2007-12-14 Thread Ben Finney
farsheed <[EMAIL PROTECTED]> writes: > Let me be clear for you: there are someone in my company who love to > use my software in other companies that she works there also. and > because it is an inhouse tool, my CEO wanted me to protect it from > stealing. If the person is that untrustworthy, yet

Re: Passing arguments to exe

2007-12-14 Thread kyosohma
On Dec 14, 4:51 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Dec 15, 9:01 am, [EMAIL PROTECTED] wrote: > > > I have created what amounts to a simple GUI email sending program > > using Python + wxPython. I have modified the mailto registration in > > the Windows Registry so that it launches the

Re: How to read a binary file into a mysql table

2007-12-14 Thread Gabriel Genellina
En Fri, 14 Dec 2007 12:19:41 -0300, Hans Müller <[EMAIL PROTECTED]> escribió: > I cannot read a binary file into a mysql database. Everything I tried > did not succeed. > > What I tried (found from various google lookups...) is this: > > con = MySQLdb.connect(to server) > cur = con.cursor() > >

Re: Is anyone happy with csv module?

2007-12-14 Thread Cliff Wells
On Wed, 2007-12-12 at 07:04 -0800, massimo s. wrote: > If by "thoroughly" you mean "it actually describes technically what it > is and does but not how to really do things", yes, it is thoroughly > documented. > The examples section is a joke. Actually I rarely use the csv module these days, but

Re: state machine and a global variable

2007-12-14 Thread tuom . larsen
On Dec 15, 12:02 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Dec 14, 2007 4:43 PM, <[EMAIL PROTECTED]> wrote: > > > > > On Dec 14, 11:06 pm, Bruno Desthuilliers > > <[EMAIL PROTECTED]> wrote: > > > [EMAIL PROTECTED] a écrit : > > > > > Dear list, > > > > I'm writing very simple state machin

Re: Can't get compiled jython to work...

2007-12-14 Thread Dave Kuhlman
kramer31 wrote: > Hi. First, I'm not sure if this is the correct group, but becuase I > couldn't find a jython newsgroup, I'll post here. > > I'm new to jython and am just trying to get it to work. Interpreted > jython works just fine, but I still can't get my compiled jython to > work. > > Wh

Re: state machine and a global variable

2007-12-14 Thread Chris Mellon
On Dec 14, 2007 4:43 PM, <[EMAIL PROTECTED]> wrote: > On Dec 14, 11:06 pm, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] a écrit : > > > > > > Dear list, > > > I'm writing very simple state machine library, like this: > > > > > _state = None > > > > > def set_state(state):

Re: Passing arguments to exe

2007-12-14 Thread John Machin
On Dec 15, 9:01 am, [EMAIL PROTECTED] wrote: > I have created what amounts to a simple GUI email sending program > using Python + wxPython. I have modified the mailto registration in > the Windows Registry so that it launches the script when someone > clicks on someone's email link in a web page. >

Re: Python import search path!

2007-12-14 Thread Bjoern Schliessmann
SMALLp wrote: > remember worked file when i wrote eg. import myFile but now in > Ubuntu it says Module not found. (I'm using Ubuntu and I've > installed python 2.5 and wxPython 2.8.4, and I'm using GedIt as my > favorite text editor). The question is how to make this work > (files are in the same

Re: state machine and a global variable

2007-12-14 Thread tuom . larsen
On Dec 14, 11:06 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] a écrit : > > > Dear list, > > I'm writing very simple state machine library, like this: > > > _state = None > > > def set_state(state): > > global _state > > _state = state > > > def get_state(): > >

Re: Source formatting fixer?

2007-12-14 Thread Gabriel Genellina
En Fri, 14 Dec 2007 15:33:44 -0300, Bret <[EMAIL PROTECTED]> escribió: > The thing is, I'm not so much trying to fix indentation issues as > spacing problems that affect readability but not program structure. > All the indentation is fine, this is more trying to change things > like: > > if ((one=

Re: py.test generative tests behavior unexpected

2007-12-14 Thread Jim Vickroy
Carl Friedrich Bolz wrote: > Jim Vickroy wrote: >> Hello all, >> >> I'm a first time user of py.tests. >> >> My setup is: >> * py.test v0.9.0 >> * Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit >> (Intel)] on win32 >> * Microsoft Windows XP Pro (service pack 2) >> >> The attached

Re: Is Python really a scripting language?

2007-12-14 Thread Martin P. Hellwig
Terry Reedy wrote: > "Ron Provost" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > But here's my problem, most of my coworkers, when they see my apps and > learn that they are written in Python ask questions like, "Why would you > write that in a scripting language?" Whenever I

Re: py.test generative tests behavior unexpected

2007-12-14 Thread Carl Friedrich Bolz
Jim Vickroy wrote: > Hello all, > > I'm a first time user of py.tests. > > My setup is: > * py.test v0.9.0 > * Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit > (Intel)] on win32 > * Microsoft Windows XP Pro (service pack 2) > > The attached file (py-test-generator-trial.py) de

Re: Python import search path!

2007-12-14 Thread SMALLp
[EMAIL PROTECTED] wrote: > On Dec 14, 3:44 pm, SMALLp <[EMAIL PROTECTED]> wrote: >> Hy! >> I'm new in Linux, and i feel little less newer in python. >> >> I need advice and help. I'm making an application witch purpose is >> irrelevant. It has a lot of code for now and I've only made interface. >>

Re: Python for Java programmer

2007-12-14 Thread Bruno Desthuilliers
Berco Beute a écrit : >>Having a decent knowledge of Python's object model > > > As explained clearly here: > > http://www.cafepy.com/article/python_types_and_objects/python_types_and_objects.html > http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html I

Re: Python import search path!

2007-12-14 Thread kyosohma
On Dec 14, 3:44 pm, SMALLp <[EMAIL PROTECTED]> wrote: > Hy! > I'm new in Linux, and i feel little less newer in python. > > I need advice and help. I'm making an application witch purpose is > irrelevant. It has a lot of code for now and I've only made interface. > So I've tried to split code into

Re: Python for Java programmer

2007-12-14 Thread Berco Beute
> Having a decent knowledge of Python's object model As explained clearly here: http://www.cafepy.com/article/python_types_and_objects/python_types_and_objects.html http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html 2B -- http://mail.python.org/mailma

Re: state machine and a global variable

2007-12-14 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Dear list, > I'm writing very simple state machine library, like this: > > > > _state = None > > def set_state(state): > global _state > _state = state > > def get_state(): > print _surface > NameError here !-) > > but I hate to use global variable

Re: Can't get compiled jython to work...

2007-12-14 Thread kyosohma
On Dec 14, 3:51 pm, kramer31 <[EMAIL PROTECTED]> wrote: > Hi. First, I'm not sure if this is the correct group, but becuase I > couldn't find a jython newsgroup, I'll post here. If you go to the main jython site at www.jython.com, you will notice a link on the left under the "Community" header t

Passing arguments to exe

2007-12-14 Thread kyosohma
I have created what amounts to a simple GUI email sending program using Python + wxPython. I have modified the mailto registration in the Windows Registry so that it launches the script when someone clicks on someone's email link in a web page. While this works great if I create a convoluted path

Re: Python for Java programmer

2007-12-14 Thread Berco Beute
Welcome to Python! One way to get you up to speed fast (and fun) is take some java app you've written and implement it in Jython. After you've done that, and gotten over the pleasant surprise of how short and clean your code has become, go over the source again and see where you can replace calls

Re: Newbie design problem

2007-12-14 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > > Bruno Desthuilliers wrote: > >>Then the first move is to carefully eval existing solutions: >>http://wiki.python.org/moin/LanguageParsing > > > Always good advice, Bruno. How did you come by that list address? > Google or is there something special known to Pytho

Re: Python for Java programmer

2007-12-14 Thread Bruno Desthuilliers
Nirav Thaker a écrit : > Yo Group, > > I'm excited to learn Python as new language coming year, I consider > myself good Java developer and, not so unusually, with very limited > experience with dynamic programming languages such as Python or Ruby. Then you'll probably have to unlearn a few thing

Can't get compiled jython to work...

2007-12-14 Thread kramer31
Hi. First, I'm not sure if this is the correct group, but becuase I couldn't find a jython newsgroup, I'll post here. I'm new to jython and am just trying to get it to work. Interpreted jython works just fine, but I still can't get my compiled jython to work. When I do this: jythonc fac.py (wh

Python import search path!

2007-12-14 Thread SMALLp
Hy! I'm new in Linux, and i feel little less newer in python. I need advice and help. I'm making an application witch purpose is irrelevant. It has a lot of code for now and I've only made interface. So I've tried to split code into separate files and in windows as I remember worked file when i

Re: state machine and a global variable

2007-12-14 Thread Carl Banks
On Dec 14, 11:52 am, [EMAIL PROTECTED] wrote: > Dear list, > I'm writing very simple state machine library, like this: > > _state = None > > def set_state(state): > global _state > _state = state > > def get_state(): > print _surface > > but I hate to use global variable. So, please, is

py.test generative tests behavior unexpected

2007-12-14 Thread Jim Vickroy
Hello all, I'm a first time user of py.tests. My setup is: * py.test v0.9.0 * Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 * Microsoft Windows XP Pro (service pack 2) The attached file (py-test-generator-trial.py) demonstrates a behavior I do not underst

Regular expression for phyton ebook, free download | http://freepdf-ebook.blogspot.com/2007/12/regex-for-python.html

2007-12-14 Thread yuni . wijayanti
download free reference regex for phyton http://freepdf-ebook.blogspot.com/2007/12/regex-for-python.html -- http://mail.python.org/mailman/listinfo/python-list

container.___le___ can use only <=?

2007-12-14 Thread Neil Cerutti
When implementing the rich comparison operators for some sort of container, it's tempting to save code by doing something like: class LarchTree: ... def __gt__(self, other): # A lot of code to traverse the tree def __le__(self): return not self > other However, if I'm thinking

Re: Is Python really a scripting language?

2007-12-14 Thread [EMAIL PROTECTED]
On Dec 14, 2:48 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Dec 14, 2007 2:09 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > On Dec 11, 10:34 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > > "Ron Provost" <[EMAIL PROTECTED]> wrote in message > > > >news:[EMAIL PROTECTED] > > >

Download new version of phyton language | http://freenewsoftware.blogspot.com/2007/12/python.html

2007-12-14 Thread yuni . wijayanti
follow this link http://freenewsoftware.blogspot.com/2007/12/python.html -- http://mail.python.org/mailman/listinfo/python-list

speed versus threading or asyncore

2007-12-14 Thread scripteaze
I need some examples on using asycore for a client app im creating. I need to be able to connect to my server 10 times and i dont want any lag nor my cpu to be taxed. The examples ive found are for the server and i dont know how to implement asyncore on the client. -- http://mail.python.org/mailm

Re: Loops and things

2007-12-14 Thread Jair Trejo
I was wondering how and if it's possible to write a loop in python which updates two or more variables at a time. For instance, something like this in C: for (i = 0, j = 10; i < 10 && j < 20; i++, j++) { printf("i = %d, j = %d\n", i, j); } So that I would get: i = 0, j = 0 i = 1, j = 1 i = 2

HTTPS GET request.

2007-12-14 Thread Jon
Hi, I'm testing an application that sends an HTTPS GET request in the form of: https://localhost/cgi-bin/parse_eas.cgi?vers=2+"&msg=This+is+a+simple+%26+short+test. I need to get a hold of that entire request for comparison / verification purposes. The closet thing I found is Sebastien Martini'

Re: Newbie design problem

2007-12-14 Thread MartinRinehart
Bruno Desthuilliers wrote: > Then the first move is to carefully eval existing solutions: > http://wiki.python.org/moin/LanguageParsing Always good advice, Bruno. How did you come by that list address? Google or is there something special known to Python experts? -- http://mail.python.org/mailm

Re: High speed web services

2007-12-14 Thread Jarek Zgoda
herbasher pisze: > How do I built highly available and lighting fast Python webservice? Write optimized code and use it in conjunction with twisted.web. -- Jarek Zgoda http://zgodowie.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python really a scripting language?

2007-12-14 Thread Chris Mellon
On Dec 14, 2007 2:09 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Dec 11, 10:34 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > "Ron Provost" <[EMAIL PROTECTED]> wrote in message > > > > news:[EMAIL PROTECTED] > > But here's my problem, most of my coworkers, when they see my apps and > >

Re: Loops and things

2007-12-14 Thread i . pantusa
On Dec 14, 5:01 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > I was wondering how and if it's possible to write a loop in python > > which updates two or more variables at a time. For instance, something > > like this in C: > > >

Re: High speed web services

2007-12-14 Thread Manlio Perillo
Il Fri, 14 Dec 2007 11:07:49 -0800, herbasher ha scritto: > Hello! > > I'm wondering: I'm really not so much into heavy frameworks like Django, > because I need to build a fast, simple python based webservice. > > That is, a request comes in at a certain URL, and I want to utilize > Python to re

Re: state machine and a global variable

2007-12-14 Thread tuom . larsen
On Dec 14, 7:35 pm, Matimus <[EMAIL PROTECTED]> wrote: > On Dec 14, 8:52 am, [EMAIL PROTECTED] wrote: > > > > > Dear list, > > I'm writing very simple state machine library, like this: > > > _state = None > > > def set_state(state): > > global _state > > _state = state > > > def get_state()

Re: Is Python really a scripting language?

2007-12-14 Thread [EMAIL PROTECTED]
On Dec 11, 10:34 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Ron Provost" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > But here's my problem, most of my coworkers, when they see my apps and > learn that they are written in Python ask questions like, "Why would you > write t

Call for Project Participation in Development Sprints at PyCon 2008

2007-12-14 Thread Facundo Batista
Python-related projects: join the PyCon Development Sprints! The development sprints are a key part of PyCon, a chance for the contributors to open-source projects to get together face-to-face for up to four days of intensive learning and development. Newbies sit at the same table as the gurus, g

Re: High speed web services

2007-12-14 Thread Matt Nordhoff
herbasher wrote: > I'm wondering: I'm really not so much into heavy frameworks like > Django, because I need to build a fast, simple python based > webservice. > > That is, a request comes in at a certain URL, and I want to utilize > Python to respond to that request. > > Ideally, I want the scri

High speed web services

2007-12-14 Thread herbasher
Hello! I'm wondering: I'm really not so much into heavy frameworks like Django, because I need to build a fast, simple python based webservice. That is, a request comes in at a certain URL, and I want to utilize Python to respond to that request. Ideally, I want the script to be "cached" so it d

Re: state machine and a global variable

2007-12-14 Thread Matimus
On Dec 14, 8:52 am, [EMAIL PROTECTED] wrote: > Dear list, > I'm writing very simple state machine library, like this: > > _state = None > > def set_state(state): > global _state > _state = state > > def get_state(): > print _surface > > but I hate to use global variable. So, please, is

Re: Source formatting fixer?

2007-12-14 Thread Bret
The thing is, I'm not so much trying to fix indentation issues as spacing problems that affect readability but not program structure. All the indentation is fine, this is more trying to change things like: if ((one==two)and(three==four)): a=b+42 c=Classname (a,b) print "Class %s create

Re: searching a value of a dict (each value is a list)

2007-12-14 Thread MonkeeSage
On Dec 10, 1:28 pm, [EMAIL PROTECTED] wrote: > Seongsu Lee: > > >I have a dictionary with million keys. Each value in the dictionary has a > >list with up to thousand integers.< > > Let's say each integer can be represented with 32 bits (if there are > less numbers then a 3-byte representation may

Re: state machine and a global variable

2007-12-14 Thread Chris Mellon
On Dec 14, 2007 10:52 AM, <[EMAIL PROTECTED]> wrote: > Dear list, > I'm writing very simple state machine library, like this: > > > > _state = None > > def set_state(state): > global _state > _state = state > > def get_state(): > print _surface > > > > but I hate to use global variable

Re: Is Python really a scripting language?

2007-12-14 Thread John Nagle
Chris Mellon wrote: > On Dec 14, 2007 2:07 AM, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >> On Thu, 13 Dec 2007 10:43:18 +0100, Bruno Desthuilliers >> <[EMAIL PROTECTED]> declaimed the >> following in comp.lang.python: >> >>> I still wait to see any clear, unambiguous definition of "scripting >>

Re: reloading modules and isinstance()

2007-12-14 Thread Diez B. Roggisch
Tlis schrieb: > Hi, > > I have found that it is possible to reassign the instance.__class__ > reference to the same class (but after reloading) to make the > isinstance() test work again! I know that it is a kind of hacking of > the Python interpreter, but it works :-) It's not especially "hackin

Re: Best way to protect my new commercial software.

2007-12-14 Thread tinnews
Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-12-14, farsheed <[EMAIL PROTECTED]> wrote: > > > Let me be clear for you: there are someone in my company who > > love to use my software in other companies that she works > > there also. and because it is an inhouse tool, my CEO wanted > > me to

Re: urlparse.urlparse bug - misparses long URL - FIX

2007-12-14 Thread John Nagle
John Nagle wrote: > John Nagle wrote: >> Matt Nordhoff wrote: >>> John Nagle wrote: Here's a hostile URL that "urlparse.urlparse" seems to have mis-parsed. >> ... >> >>> >>> It's breaking on the first slash, which just happens to be very late in >>> the URL. >>> >> urlparse('http

Re: RegExp Help

2007-12-14 Thread Sean DiZazzo
On Dec 14, 3:06 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 14 Dec 2007 06:06:21 -0300, Sean DiZazzo <[EMAIL PROTECTED]> > escribió: > > > > > On Dec 14, 12:04 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > >> On Thu, 13 Dec 2007 17:49:20 -0800, Sean DiZazzo wrote: > >

Re: replacing built-in exception types

2007-12-14 Thread Stargaming
On Tue, 11 Dec 2007 12:51:52 -0800, Nishkar Grover wrote: > I'm trying to replace a built-in exception type and here's a simplified > example of what I was hoping to do... > > > >>> import exceptions, __builtin__ > >>> > >>> zeroDivisionError = exceptions.ZeroDivisionError I don't know why y

Re: Compressing a text file using count of continous characters

2007-12-14 Thread nirvana
On Dec 14, 12:07 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Dec 14, 2007 10:54 AM, nirvana <[EMAIL PROTECTED]> wrote: > > > I need to count the number of continous character occurances(more than > > 1) in a file, and replace it with a compressed version, like below > > XYZDEFAAcdAA

Re: Python for Java programmer

2007-12-14 Thread George Sakkis
On Dec 14, 11:53 am, Nirav Thaker <[EMAIL PROTECTED]> wrote: > Yo Group, > > I'm excited to learn Python as new language coming year, I consider > myself good Java developer and, not so unusually, with very limited > experience with dynamic programming languages such as Python or Ruby. > > I have s

Re: Compressing a text file using count of continous characters

2007-12-14 Thread Chris Mellon
On Dec 14, 2007 10:54 AM, nirvana <[EMAIL PROTECTED]> wrote: > I need to count the number of continous character occurances(more than > 1) in a file, and replace it with a compressed version, like below > XYZDEFAAcdAA --> XYZ8ADEF2Acd2A > This sounds like homework. Google for run length e

Re: Compressing a text file using count of continous characters

2007-12-14 Thread Marc 'BlackJack' Rintsch
On Fri, 14 Dec 2007 08:54:58 -0800, nirvana wrote: > I need to count the number of continous character occurances(more than > 1) in a file, and replace it with a compressed version, like below > XYZDEFAAcdAA --> XYZ8ADEF2Acd2A Great. Then go ahead an implement it. :-) `itertools.groupb

Re: Job Offer: Python Ninja or Pirate!

2007-12-14 Thread George Sakkis
On Dec 14, 9:57 am, Stargaming <[EMAIL PROTECTED]> wrote: > On Tue, 11 Dec 2007 08:57:16 -0800, George Sakkis wrote: > > Closer, but still wrong; for some weird reason, __import__ for modules > > in packages returns the top level package by default; you have to use > > the 'fromlist' argument: > >

Compressing a text file using count of continous characters

2007-12-14 Thread nirvana
I need to count the number of continous character occurances(more than 1) in a file, and replace it with a compressed version, like below XYZDEFAAcdAA --> XYZ8ADEF2Acd2A Thanks Sumod -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to protect my new commercial software.

2007-12-14 Thread Grant Edwards
On 2007-12-14, farsheed <[EMAIL PROTECTED]> wrote: > Let me be clear for you: there are someone in my company who > love to use my software in other companies that she works > there also. and because it is an inhouse tool, my CEO wanted > me to protect it from stealing. and really we havn't time t

Python for Java programmer

2007-12-14 Thread Nirav Thaker
Yo Group, I'm excited to learn Python as new language coming year, I consider myself good Java developer and, not so unusually, with very limited experience with dynamic programming languages such as Python or Ruby. I have started with basics at http://docs.python.org, but I'm more interested in

state machine and a global variable

2007-12-14 Thread tuom . larsen
Dear list, I'm writing very simple state machine library, like this: _state = None def set_state(state): global _state _state = state def get_state(): print _surface but I hate to use global variable. So, please, is there a better way of doing this? All I want is that a user has

Re: Is Python really a scripting language?

2007-12-14 Thread Chris Mellon
On Dec 14, 2007 2:07 AM, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 13 Dec 2007 10:43:18 +0100, Bruno Desthuilliers > <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > > > > > I still wait to see any clear, unambiguous definition of "scripting > > language". Which one

Re: urlparse.urlparse bug - misparses long URL

2007-12-14 Thread John Nagle
John Nagle wrote: > Matt Nordhoff wrote: >> John Nagle wrote: >>> Here's a hostile URL that "urlparse.urlparse" seems to have mis-parsed. >>> > ... > >> >> It's breaking on the first slash, which just happens to be very late in >> the URL. >> > urlparse('http://example.com?blahblah=http:/

Re: [Python] Re: efficient data loading with Python, is that possible possible?

2007-12-14 Thread Chris Gonnerman
Neil Cerutti wrote: > An inefficient parsing technique is probably to blame. You first > inspect the line to make sure it is valid, then you inspect it > (number of column type) times to discover what data type it > contains, and then you inspect it *again* to finally translate > it. > I was thi

Tk Tkinter : multiple file selection dialog over multiple directories ?

2007-12-14 Thread goldtech
Hi, TKinter question Let's say I use: ... files = tkFileDialog.askopenFilenames(filetypes=[('AccessDB Files', '*.mdb')]) ... This works OK - I can select multiple files and the var "files" will be a tuple of the files. But let's say the files I want to select are in different folders/ director

Re: "do" as a keyword

2007-12-14 Thread Tobiah
> But reading through the warts and reading about a lack of "do while > statements" I also started to ponder about the "'do something' if > 'true' else 'do this'", and pondered if perhaps this statement could > do with the including of the keyword do. I often miss what can be done in other langua

Re: Clearing a DOS terminal in a script

2007-12-14 Thread Chris Gonnerman
Stephen_B wrote: > This doesn't seem to work in a dos terminal at the start of a script: > > from os import popen > print popen('clear').read() > > Any idea why not? Thanks. > As others have mentioned, you should just do: os.system("cls") Or, you can use my WConio module for fancier work. htt

SpamBayes/Windows volunteer help needed

2007-12-14 Thread skip
The SpamBayes antispam filter (http://www.spambayes.org/) is fairly popular as a way to suppress spam. We have lots of people who use the Outlook plugin. Unfortunately, for the past year or two we've suffered from a dearth of Windows experience as our Windows development experts all got busy doin

Re: [Plone-Users] Why Can't I Do This?

2007-12-14 Thread Tommy Grav
On Dec 14, 2007, at 11:21 AM, Victor Subervi wrote: > whatever[0:2] will yield THREE characters, so my "by " is correct > and "by" will fail every time :)) > Victor Nope, whatever[0:2] is two characters: ActivePython 2.5.1.1 (ActiveState Software Inc.) based on Python 2.5.1 (r251:54863, May

Re: Newbie design problem

2007-12-14 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Most unclear. My apologies. > > I'm trying to structure a tokenizer. The stupid concatenations are > just placeholders for the actual tokenizing work. By rebuilding the > input they demonstrate that the framework correctly processes all the > input. > > I'm currently

Re: Newbie design problem

2007-12-14 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Jonathan Garnder said: > >> Well, if using something like PLY ( http://www.dabeaz.com/ply/ ) is >> considered more Pythonic than writing your own parser and lexer... > > Lex is very crude. Possibly. Anyway, there are quite a few other parser generators : http://wik

Re: [Plone-Users] Why Can't I Do This?

2007-12-14 Thread Victor Subervi
whatever[0:2] will yield THREE characters, so my "by " is correct and "by" will fail every time :)) Victor On Dec 14, 2007 12:06 PM, Derek Broughton <[EMAIL PROTECTED]> wrote: > Encolpe Degoute wrote: > > > Derek Broughton a écrit : > >> Victor Subervi wrote: > >> > >>> Hi; > >>> Why can't I do t

DB Query Parse Hangup

2007-12-14 Thread Merrigan
Hi There, I have been working on this script, and the part that this issue that I have occurs in is when iterating through some results from the db, asking the admin input to delete the entry or not - everything works fine up until the last entry, then it bombs out. I know why - but I am not quite

Re: Newbie design problem

2007-12-14 Thread MartinRinehart
Jonathan Garnder said: > Well, if using something like PLY ( http://www.dabeaz.com/ply/ ) is > considered more Pythonic than writing your own parser and lexer... Lex is very crude. I've found that it takes about half a day to organize your token definitions and another half day to write a tokeniz

Re: simple string formatting question

2007-12-14 Thread Neil Cerutti
On 2007-12-14, Neal Becker <[EMAIL PROTECTED]> wrote: > I have a list of strings (sys.argv actually). I want to print them as a > space-delimited string (actually, the same way they went into the command > line, so I can cut and paste) > > So if I run my program like: > ./my_prog a b c d > > I wan

Re: Loops and things

2007-12-14 Thread Neil Cerutti
On 2007-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I was wondering how and if it's possible to write a loop in python > which updates two or more variables at a time. For instance, something > like this in C: > > for (i = 0, j = 10; i < 10 && j < 20; i++, j++) { > printf("i = %d, j =

  1   2   >