Re: Getting sorting order

2008-07-01 Thread Paddy
On Jul 1, 8:26 pm, Tobiah <[EMAIL PROTECTED]> wrote: > master,slave1,slave2=zip(*x) > > What does the asterisk do here? > > Thanks > ** Posted fromhttp://www.teranews.com** Hi Tobiah, I blogged extensively on this zip(*x) trick here: http://paddy3118.blogspot.com/2007/02/unzip-un-needed-in-

n00bie wants advice.

2008-07-01 Thread bsagert
This simple script writes html color codes that can be viewed in a browser. I used short form hex codes (fff or 000, etc) and my list has only six hex numbers otherwise the results get rather large. I invite criticism as to whether my code is "pythonic". Are there other ways to generate the hex co

Python and timezones

2008-07-01 Thread [EMAIL PROTECTED]
I'm trying to write some code to deal with world timezones, and I'm getting a strange result. America/Iqaluit should not be showing up in UTC+00:00, but it is. Can anyone see what's wrong with this code? import time from datetime import datetime import os import pytz def getZoneNamesOnThisComp

How to pickle bound methods

2008-07-01 Thread srinivasan srinivas
Hi, I would like to know how to pickle a bound method?? Thanks, Srini Meet people who discuss and share your passions. Go to http://in.promos.yahoo.com/groups/bestofyahoo/ -- http://mail.python.org/mailman/listinfo/python-list

how to used pyodbc to connect foxpro table

2008-07-01 Thread ajak_yahoo
Good Morning to All, Can anyone help me to connect pyodbc to foxpro table. Below code can't works. import pyodbc cnxn = pyodbc.connect("DSN=sls_detl") Traceback (most recent call last): File "", line 1, in cnxn = pyodbc.connect("DSN=sls_detl") Error: ('S1000', "[S1000] [Microsoft][ODBC V

Re: pyparsing problem

2008-07-01 Thread Paul McGuire
On Jul 1, 8:02 am, name <[EMAIL PROTECTED]> wrote: > Hi, > > I try to parse a file with pyparsing and get this output: > >     ['generic', 'host-01', 'host alias xyz', '10.0.0.1'] >     - alias: host alias xyz >     - host_name: ['host-01'] >     - ip_address: ['10.0.0.1'] >     - use: ['generic']

Re: Classes for processing/parsing Wiki Markup text

2008-07-01 Thread Michael Mabin
Thanks! This looks like just what I need! :) On Tue, Jul 1, 2008 at 1:25 PM, Joshua Kugler <[EMAIL PROTECTED]> wrote: > Michael Mabin wrote: > > > Does anyone know if there are any generally available classes for parsing > > various wiki markup formats? > > Several here: > > http://pypi.python.o

Re: The Importance of Terminology's Quality

2008-07-01 Thread John W Kennedy
Robert Maas, http://tinyurl.com/uh3t wrote: Why this response is so belated: = Date: Tue, 24 Jun 2008 18:42:15 -0400 From: John W Kennedy <[EMAIL PROTECTED]> ... the "thunks" were necessary at the machine-

Re: How to make a function associated with a class?

2008-07-01 Thread John Roth
On Jul 1, 2:43 pm, Kurda Yon <[EMAIL PROTECTED]> wrote: > Hi, > > I have a class called "vector". And I would like to define a function > "dot" which would return a dot product of any two "vectors". I want > to call this function as follow: dot(x,y). > > Well, I can define a functions "dot" outsid

Re: httplib HTTP: Logging request message

2008-07-01 Thread tom
I guess the easies way to do it is to copy and modify the httplib module to log both outgoing and incoming messages. -- http://mail.python.org/mailman/listinfo/python-list

Re: raw_input into Tkinter ?

2008-07-01 Thread s0suk3
On Jun 30, 11:55 am, [EMAIL PROTECTED] wrote: > Is there any way to type into a Tkinter frame window? > I want to use raw_input() within a Tkinter frame. import sys import Tkinter import cStringIO class GUIInputMgr(Tkinter.Entry): def __init__(self, parent): Tkinter.Entry.__init__(se

Re: SQLite and Python 2.4

2008-07-01 Thread Guilherme Polo
On Tue, Jul 1, 2008 at 9:51 PM, Joe Goldthwaite <[EMAIL PROTECTED]> wrote: > I'm confused. (Not a new experience). I've got a web application running > under Zope. I use the Wing IDE for testing and debugging. When trying to > recreate problems that come up on the web, I wrote some little routi

SQLite and Python 2.4

2008-07-01 Thread Joe Goldthwaite
I'm confused. (Not a new experience). I've got a web application running under Zope. I use the Wing IDE for testing and debugging. When trying to recreate problems that come up on the web, I wrote some little routines that pull my cookies out of the Firefox cookies.txt file into my code. That w

Re: convert unicode characters to visibly similar ascii characters

2008-07-01 Thread Ben Finney
Jim <[EMAIL PROTECTED]> writes: > I don't like the spacing in [PEP 8], personally. Nevertheless, your Python code will be much less effort to read by others (and yourself in future) if it is written in conformance with PEP 8. Writing all your Python code to conform with that standard is the simp

Re: convert unicode characters to visibly similar ascii characters

2008-07-01 Thread Jim
On Jul 1, 8:29 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 2, 9:55 am, Jim <[EMAIL PROTECTED]> wrote: > > Comments on the above grep output: > 1. You have SOFT HYPHEN twice, mapping it to u'-' and '-' Hmph. I'll correct that. Thanks. > 2. The idea of a soft hyphen is as a hint to a hyphena

Re: convert unicode characters to visibly similar ascii characters

2008-07-01 Thread Jim
On Jul 1, 8:29 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 2, 9:55 am, Jim <[EMAIL PROTECTED]> wrote: > > Comments on the above grep output: > 1. You have SOFT HYPHEN twice, mapping it to u'-' and '-' Hmph. I'll correct that. Thanks. > 2. The idea of a soft hyphen is as a hint to a hyphena

Re: convert unicode characters to visibly similar ascii characters

2008-07-01 Thread John Machin
On Jul 2, 9:55 am, Jim <[EMAIL PROTECTED]> wrote: > Peter Bulychev wrote: > > I want to convert unicode character into ascii one. > > You have to make some arbitrary choices of what to translate. Based > on some materials on effbot's site, and a recipe, I made > ftp://alan.smcvt.edu/hefferon/uni

beginner's questions - manipulating text files

2008-07-01 Thread Ben Keshet
Hi, I am a very beginner Python programmer with limited programming experience overall. I am trying to write a script that will search for the second and third appearance of the symbol '@' in a file, will read a random line between them, and write the line into a new file. So far I was only

Re: convert unicode characters to visibly similar ascii characters

2008-07-01 Thread Jim
Peter Bulychev wrote: > I want to convert unicode character into ascii one. You have to make some arbitrary choices of what to translate. Based on some materials on effbot's site, and a recipe, I made ftp://alan.smcvt.edu/hefferon/unicode2ascii.py which has at least some of what you are looking

Re: convert unicode characters to visibly similar ascii characters

2008-07-01 Thread Jim
Peter Bulychev wrote: > I want to convert unicode character into ascii one. You have to make some arbitrary choices of what to translate. Based on some materials on effbot's site, and a recipe, I made ftp://alan.smcvt.edu/hefferon/unicode2ascii.py which has at least some of what you are looking

Re: Attribute reference design

2008-07-01 Thread Gary Herron
chamalulu wrote: On Jul 2, 1:17 am, Gary Herron <[EMAIL PROTECTED]> wrote: No need. Also, you can define a class attribute (C++ might call it a static attribute) and access it transparently through an instance. class C: aClassAttribute = 123 def __init__(self, ...): ... c = C() ..

Re: Attribute reference design

2008-07-01 Thread chamalulu
On Jul 2, 1:17 am, Gary Herron <[EMAIL PROTECTED]> wrote: > No need. Also, you can define a class attribute (C++ might call it a > static attribute) and access it transparently through an instance. > > class C: > aClassAttribute = 123 > def __init__(self, ...): > ... > > c = C() > ... do

Re: Required items in a form

2008-07-01 Thread Benjamin Kaplan
On Tue, Jul 1, 2008 at 6:20 PM, Brandon <[EMAIL PROTECTED]> wrote: > What I'm trying to do is essentially force a user to fill in required items > in a form, which will be saved to a database. How can I get it so that > once > the user clicks "OK" on the dialog box, it transfers control back to t

Re: Attribute reference design

2008-07-01 Thread Gary Herron
chamalulu wrote: On Jul 1, 11:24 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: chamalulu schrieb: Hello. I think I'm aware of how attribute access is resolved in python. When referencing a class instance attribute which is not defined in the scope of the instance, Python looks for

Re: Attribute reference design

2008-07-01 Thread chamalulu
On Jul 1, 11:24 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > chamalulu schrieb: > > > Hello. > > I think I'm aware of how attribute access is resolved in python. When > > referencing a class instance attribute which is not defined in the > > scope of the instance, Python looks for a class at

Re: Implementing an 8 bit fixed point register

2008-07-01 Thread Grant Edwards
On 2008-07-01, Terry Reedy <[EMAIL PROTECTED]> wrote: >>> A bytearray subclass could enforce that all 'bits' (stored as >>> bytes) are 0 or 1, have a customized representation to your >>> taste, and add methods like .flipall(). >> >> It seems like implementing ALU operations on such arrays would

Required items in a form

2008-07-01 Thread Brandon
What I'm trying to do is essentially force a user to fill in required items in a form, which will be saved to a database. How can I get it so that once the user clicks "OK" on the dialog box, it transfers control back to the form, and not save the empty fields into the database? -- http://ma

Re: Implementing an 8 bit fixed point register

2008-07-01 Thread Terry Reedy
Grant Edwards wrote: On 2008-07-01, Terry Reedy <[EMAIL PROTECTED]> wrote: nickola wrote: Hello to all I'm about to write a simulator for a microcontroller in python (why python? because I love it!!!) but I have a problem. The registry of this processor are all 8 bit long (and 10 bit f

Re: How to make a function associated with a class?

2008-07-01 Thread [EMAIL PROTECTED]
On Jul 1, 2:24 pm, Kurda Yon <[EMAIL PROTECTED]> wrote: > > By the way, "type(self)" returns the name of the class to which the > "self" belongs? > Does "instance" return "true" if the first argument belongs to the > class whose name is given in the second argument? $ python Python 2.5.1 (r251:548

Re: How to make a function associated with a class?

2008-07-01 Thread [EMAIL PROTECTED]
On Jul 1, 1:43 pm, Kurda Yon <[EMAIL PROTECTED]> wrote: > Hi, > > I have a class called "vector". And I would like to define a function > "dot" which would return a dot product of any two "vectors". I want > to call this function as follow: dot(x,y). > > Well, I can define a functions "dot" outsid

Re: Error from zipfile

2008-07-01 Thread John Machin
On Jul 2, 1:38 am, "Wesley Brooks" <[EMAIL PROTECTED]> wrote: > Dear Users, > > I'm having a problem when trying to move script from Linux to Windows. > A zipfile opperation is failing with the message: > > "BadZipFile: File is not a zip file" > > I have a simple scripts that reads a zip file in th

AttributeError with embedded Python

2008-07-01 Thread PlayDough
I've embedded Python in an extension for a program we are using here at work. And I'm a bit stumped as to why I am getting an AttributeError only in the embedded Python. First, a bit of what I am doing. We use a simulator for a microprocessor we are using in our systems. Our simulator allows fo

Combination of element-wise and matrix multiplication

2008-07-01 Thread Jonno
I have two 2x2 arrays a & b. a=(([c,d],[e,f])) b=(([g,h],[i,j])) Each of c,d,e,f,g,h,i,j are all 1xN arrays I want to matrix multiply a & b to create a 2x2 array x, where the elements of x are created with element-wise math and result in the following: x[0,0] = c*g+d*i x[0,1] = c*h+d*j x[1,0] = e*g

Re: How to make a function associated with a class?

2008-07-01 Thread Victor Noagbodji
> > Hi, > > I have a class called "vector". And I would like to define a function > "dot" which would return a dot product of any two "vectors". I want > to call this function as follow: dot(x,y). > > Well, I can define a functions "dot" outside the class and it works > exactly as I want. However,

Re: Why is recursion so slow?

2008-07-01 Thread Rich Harkins
Nick Craig-Wood wrote: [snip] By definition any function in a functional language will always produce the same result if given the same arguments, so you can memoize any function. Ah, so that's why time.time() seems to be stuck... ;) Rich -- http://mail.python.org/mailman/listinfo/python-li

Re: Getting sorting order

2008-07-01 Thread Nick Craig-Wood
Tobiah <[EMAIL PROTECTED]> wrote: > master,slave1,slave2=zip(*x) > > What does the asterisk do here? > > Thanks > ** Posted from http://www.teranews.com ** Instead of passing a single argument x to zip() you can think of it unpacking the list x and passing len(x) arguments to zip. So if

Re: How to make a function associated with a class?

2008-07-01 Thread Kurda Yon
On Jul 1, 5:01 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 1 juil, 22:43, Kurda Yon <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I have a class called "vector". And I would like to define a function > > "dot" which would return a dot product of any two "vectors". I want > > to call t

Re: Attribute reference design

2008-07-01 Thread Diez B. Roggisch
chamalulu schrieb: Hello. I think I'm aware of how attribute access is resolved in python. When referencing a class instance attribute which is not defined in the scope of the instance, Python looks for a class attribute with the same name. (For assignment or deletion this is not the case, thankf

Attribute reference design

2008-07-01 Thread chamalulu
Hello. I think I'm aware of how attribute access is resolved in python. When referencing a class instance attribute which is not defined in the scope of the instance, Python looks for a class attribute with the same name. (For assignment or deletion this is not the case, thankfully.) I've been tryi

Re: How to make a function associated with a class?

2008-07-01 Thread [EMAIL PROTECTED]
On 1 juil, 22:43, Kurda Yon <[EMAIL PROTECTED]> wrote: > Hi, > > I have a class called "vector". And I would like to define a function > "dot" which would return a dot product of any two "vectors". I want > to call this function as follow: dot(x,y). > > Well, I can define a functions "dot" outside

Re: Why is recursion so slow?

2008-07-01 Thread [EMAIL PROTECTED]
On 1 juil, 22:46, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: (snip) > By definition any function in a functional language will > always produce the same result if given the same arguments, This is only true for pure functional languages. I know you know it, but someone might think it also appli

Re: Please check my understanding...

2008-07-01 Thread Marc 'BlackJack' Rintsch
On Tue, 01 Jul 2008 12:35:01 -0700, Tobiah wrote: > list.append([1,2]) will add the two element list as the next > element of the list. > > list.extend([1,2]) is equivalent to list = list + [1, 2] > and the result is that each element of the added list > becomes it's own new element in the origin

Re: raw_input into Tkinter ?

2008-07-01 Thread Sebastian "lunar" Wiesner
Matimus <[EMAIL PROTECTED]>: > On Jun 30, 9:55 am, [EMAIL PROTECTED] wrote: >> Is there any way to type into a Tkinter frame window? >> I want to use raw_input() within a Tkinter frame. > > `raw_input(prompt)` just calls `sys.stdout.write(prompt)` and returns > `sys.stdin.readline()`. It does mor

Re: Why is recursion so slow?

2008-07-01 Thread Nick Craig-Wood
Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > > is that what lazy evaluation in functional languages avoids thus > > making recursive versions much faster? > > Not exactly... Functional languages are (or should be) optimized for > recursion, > but if the algorithm you write is still exponential

Re: Please check my understanding...

2008-07-01 Thread [EMAIL PROTECTED]
On 1 juil, 21:35, Tobiah <[EMAIL PROTECTED]> wrote: > list.append([1,2]) will add the two element list as the next > element of the list. list.append(obj) will add obj as the last element of list, whatever type(obj) is. > list.extend([1,2]) is equivalent to list = list + [1, 2] Not quite. The se

How to make a function associated with a class?

2008-07-01 Thread Kurda Yon
Hi, I have a class called "vector". And I would like to define a function "dot" which would return a dot product of any two "vectors". I want to call this function as follow: dot(x,y). Well, I can define a functions "dot" outside the class and it works exactly as I want. However, the problem is

Re: Please check my understanding...

2008-07-01 Thread Matimus
On Jul 1, 12:35 pm, Tobiah <[EMAIL PROTECTED]> wrote: > list.append([1,2]) will add the two element list as the next > element of the list. > > list.extend([1,2]) is equivalent to list = list + [1, 2] > and the result is that each element of the added list > becomes it's own new element in the orig

Re: ImportError: No module named _md5

2008-07-01 Thread Robert Kern
[EMAIL PROTECTED] wrote: Hello, Does anyone know how to fix this error when trying to build MySQL- python-1.2.2: python setup.py build Traceback (most recent call last): File "setup.py", line 5, in import ez_setup; ez_setup.use_setuptools() File "/Users/jasonnerida/Downloads/MySQL-pyth

Re: convert unicode characters to visibly similar ascii characters

2008-07-01 Thread Terry Reedy
Peter Bulychev wrote: Hello. I want to convert unicode character into ascii one. The method ".encode('ASCII') " can convert only those unicode characters, which fit into 0..128 range. But there are still lots of characters beyond this range, which can be manually converted to some visibly

Re: Implementing an 8 bit fixed point register

2008-07-01 Thread Grant Edwards
On 2008-07-01, Terry Reedy <[EMAIL PROTECTED]> wrote: > > > nickola wrote: >> Hello to all >> I'm about to write a simulator for a microcontroller in python >> (why python? because I love it!!!) >> >> but I have a problem. >> >> The registry of this processor are all 8 bit long (and 10 bit fo

Please check my understanding...

2008-07-01 Thread Tobiah
list.append([1,2]) will add the two element list as the next element of the list. list.extend([1,2]) is equivalent to list = list + [1, 2] and the result is that each element of the added list becomes it's own new element in the original list. Is that the only difference? >From the manual: s.ex

Re: Convert string to char array

2008-07-01 Thread Brandon
Thank you both for your help. "Mike Kent" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Jul 1, 2:49 pm, "Brandon" <[EMAIL PROTECTED]> wrote: > How do I convert a string to a char array? I am doing this so I can edit > the string received from an sql query so I can remove unnecess

Re: Getting sorting order

2008-07-01 Thread Tobiah
master,slave1,slave2=zip(*x) What does the asterisk do here? Thanks ** Posted from http://www.teranews.com ** -- http://mail.python.org/mailman/listinfo/python-list

Re: convert unicode characters to visibly similar ascii characters

2008-07-01 Thread Laszlo Nagy
Peter Bulychev wrote: Thank you for you answer. If you only want this to work for a subset, please define that subset. Actually, I want to convert only punctuations (dots, commas, hyphens and so on). Then make your translation table manually and apply this method: unicode.translate Fina

Re: Implementing an 8 bit fixed point register

2008-07-01 Thread Terry Reedy
nickola wrote: Hello to all I'm about to write a simulator for a microcontroller in python (why python? because I love it!!!) but I have a problem. The registry of this processor are all 8 bit long (and 10 bit for some other strange register) and I need to simulate the fixed point behavio

Re: Convert string to char array

2008-07-01 Thread Mike Kent
On Jul 1, 2:49 pm, "Brandon" <[EMAIL PROTECTED]> wrote: > How do I convert a string to a char array?  I am doing this so I can edit > the string received from an sql query so I can remove unnecessary > characters. Answering your specific question: Python 2.5.1 (r251:54863, Mar 31 2008, 11:09:52)

Re: Convert string to char array

2008-07-01 Thread Larry Bates
Brandon wrote: How do I convert a string to a char array? I am doing this so I can edit the string received from an sql query so I can remove unnecessary characters. The precise answer is: >>> s = 'abcdefghi' >>> l = list(s) >>> l ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'] >>> But qui

Re: connecting to DBMS

2008-07-01 Thread teebes
On Jul 1, 9:35 am, varun chadha <[EMAIL PROTECTED]> wrote: > i am a newbie to python and is working on an application which needs > to connect to the database. can anyone guide me through the DBMS that > i can use and the module to connect to it. currently i have MySQL > installed using the link on

Re: convert unicode characters to visibly similar ascii characters

2008-07-01 Thread Peter Bulychev
Thank you for you answer. If you only want this to work for a subset, please define that subset. Actually, I want to convert only punctuations (dots, commas, hyphens and so on). -- Best regards, Peter Bulychev. -- http://mail.python.org/mailman/listinfo/python-list

Convert string to char array

2008-07-01 Thread Brandon
How do I convert a string to a char array? I am doing this so I can edit the string received from an sql query so I can remove unnecessary characters. -- http://mail.python.org/mailman/listinfo/python-list

Re: convert unicode characters to visibly similar ascii characters

2008-07-01 Thread Laszlo Nagy
Peter Bulychev wrote: Hello. I want to convert unicode character into ascii one. The method ".encode('ASCII') " can convert only those unicode characters, which fit into 0..128 range. But there are still lots of characters beyond this range, which can be manually converted to some visibly si

convert unicode characters to visibly similar ascii characters

2008-07-01 Thread Peter Bulychev
Hello. I want to convert unicode character into ascii one. The method ".encode('ASCII') " can convert only those unicode characters, which fit into 0..128 range. But there are still lots of characters beyond this range, which can be manually converted to some visibly similar ascii characters. For

Re: Classes for processing/parsing Wiki Markup text

2008-07-01 Thread Joshua Kugler
Michael Mabin wrote: > Does anyone know if there are any generally available classes for parsing > various wiki markup formats? Several here: http://pypi.python.org/pypi?%3Aaction=search&term=wiki&submit=search I'm sure you could find a good one, and add your own markup if needed. j -- http:/

Re: How to use gnu readline library in program?

2008-07-01 Thread Grant Edwards
>> What I want to do is replace sys.stdin.readline() with >> something that will provide the user with line editing and >> history recall. In other languages, one uses the Gnu readline >> library to do that, but my reading of the Python library >> documentation is that's not what the Python readli

Re: ask for a RE pattern to match TABLE in html

2008-07-01 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > On Jun 27, 10:32 am, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > > (ii) The regexes in languages like Python and Perl include > > features that are not part of the formal CS notion of > > "regular expression". Do t

Re: dynamically load from module import xxx

2008-07-01 Thread Guilherme Polo
On Tue, Jul 1, 2008 at 12:55 PM, Neal Becker <[EMAIL PROTECTED]> wrote: > Guilherme Polo wrote: > >> On Tue, Jul 1, 2008 at 12:11 PM, Neal Becker <[EMAIL PROTECTED]> wrote: >>> What is a good way to emulate: >>> >>> from module import xxx >>> where 'module' is a dynamically generated string? >>> >>

Re: wrong md5 checksum

2008-07-01 Thread Peter Pearson
On Tue, 01 Jul 2008 17:54:05 +0200, kkwweett <[EMAIL PROTECTED]> wrote: > kkwweett a écrit : >> Hi, >> >> the download page (http://www.python.org/download/releases/3.0/) for >> Python 3000 shows : >> >> 9119625244b17aa35ed94b655a2b2135 13491200 python-3.0b1.msi >> >> but I got >> >> 9119625

Classes for processing/parsing Wiki Markup text

2008-07-01 Thread Michael Mabin
Does anyone know if there are any generally available classes for parsing various wiki markup formats? -- | _ | * | _ | | _ | _ | * | | * | * | * | -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding Python

2008-07-01 Thread Marcin Krol
Hello everyone, In the meantime I managed to work out another solution, mainly thanks to reading the source code of some OSS projects. I post it here so somebody else looking for solution to this problem had the example available: cut #include #include #include #include #include

Re: Embedding Python

2008-07-01 Thread Marcin Krol
Carsten Haese wrote: python_code is a C string containing the raw bytes from your pyc file. Casting that to a PyObject pointer will not magically transform it into a Python code object. well yeah, I kind of didn't think that through.. A pyc file contains the following: 1) An 8 byte head

Re: Embedding Python

2008-07-01 Thread Marcin Krol
Pau Freixes wrote: If you search this function name into Google you will can found some examples, use for example PyMarshal_ReadObjectFromString or PyMarshal_ReadObjectFromFile Rest assured I looked at a lot of code, but none of it was reading in the .pyc file. I had no idea about the 8-byte h

Re: How to use gnu readline library in program?

2008-07-01 Thread Peter Otten
Grant Edwards wrote: > I'm trying to figure out how to use the gnu readline library so > that when my program is prompting the user for input there is > line editing and history support. > > I've read and re-read the documentation for the "readline" > module in the standard library and I still ca

Re: dynamically load from module import xxx

2008-07-01 Thread Neal Becker
Guilherme Polo wrote: > On Tue, Jul 1, 2008 at 12:11 PM, Neal Becker <[EMAIL PROTECTED]> wrote: >> What is a good way to emulate: >> >> from module import xxx >> where 'module' is a dynamically generated string? >> >> __import__ ('modulename', fromlist=['xxx']) >> >> seems to be what I want, but t

Re: wrong md5 checksum

2008-07-01 Thread kkwweett
kkwweett a écrit : Hi, the download page (http://www.python.org/download/releases/3.0/) for Python 3000 shows : 9119625244b17aa35ed94b655a2b2135 13491200 python-3.0b1.msi but I got 9119625244a57aa35ed94b655a2b2135 13491200 python-3.0b1.msi (44a57 rather than 44b17 ) with several md5 c

Discover Islam - The Fastest Growing Religion in the World !

2008-07-01 Thread ah
Correct your information about Islam , The Misunderstood Religion When you are ready_ you can enter this place!!! http://sultan.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Error from zipfile

2008-07-01 Thread Marc 'BlackJack' Rintsch
On Tue, 01 Jul 2008 16:38:23 +0100, Wesley Brooks wrote: > Dear Users, > > I'm having a problem when trying to move script from Linux to Windows. > A zipfile opperation is failing with the message: > > "BadZipFile: File is not a zip file" > > I have a simple scripts that reads a zip file in the

Re: Installing paramiko and pycrypto

2008-07-01 Thread GHZ
I installed from here: http://bazaar-vcs.org/WindowsInstall first pycrypto-2.0.1.win32-py2.5.zip then paramiko-1.7.1-ctypes.win32.exe -- http://mail.python.org/mailman/listinfo/python-list

Error from zipfile

2008-07-01 Thread Wesley Brooks
Dear Users, I'm having a problem when trying to move script from Linux to Windows. A zipfile opperation is failing with the message: "BadZipFile: File is not a zip file" I have a simple scripts that reads a zip file in the same way as any other file into a string, then sends it across to a netwo

Re: How do web templates separate content and logic?

2008-07-01 Thread Kirk Strauser
At 2008-06-30T19:34:53Z, Mike <[EMAIL PROTECTED]> writes: > I should have say "why embedding HTML into Python is not good enough?" ;=) I'm a programmer and would be able to cope with embedding HTML in assembler if the need arose. Having said that, embedding HTML in anything but HTML tends to be

Re: Implementing an 8 bit fixed point register

2008-07-01 Thread nickooooola
Thanks to all for the responses! to MEl: I also want to build a pic simulator, but I want to do this as "python for big project" learning exercise, I have used python in the past only for small script and now I want to use it for something more "big". do you have some code to share? myhdl seems i

How to use gnu readline library in program?

2008-07-01 Thread Grant Edwards
I'm trying to figure out how to use the gnu readline library so that when my program is prompting the user for input there is line editing and history support. I've read and re-read the documentation for the "readline" module in the standard library and I still can't figure out how to use the modu

Re: dynamically load from module import xxx

2008-07-01 Thread Guilherme Polo
On Tue, Jul 1, 2008 at 12:11 PM, Neal Becker <[EMAIL PROTECTED]> wrote: > What is a good way to emulate: > > from module import xxx > where 'module' is a dynamically generated string? > > __import__ ('modulename', fromlist=['xxx']) > > seems to be what I want, but then it seems 'xxx' is not placed

Re: Scope and program structure problems

2008-07-01 Thread Bruno Desthuilliers
John Dann a écrit : Many thanks for the repsonse - much appreciated. And sorry - yes I was probably compounding two separate issues here - the GUI one and the variable scope one. Maybe the wxPython list would be the best place to ask more about the GUI side of things. Then actually I can simpl

dynamically load from module import xxx

2008-07-01 Thread Neal Becker
What is a good way to emulate: from module import xxx where 'module' is a dynamically generated string? __import__ ('modulename', fromlist=['xxx']) seems to be what I want, but then it seems 'xxx' is not placed in globals() (which makes me wonder, what exactly did fromlist do?) -- http://mail.p

RE: How make regex that means "contains regex#1 but NOT regex#2" ??

2008-07-01 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Reedick, Andrew > Sent: Tuesday, July 01, 2008 10:07 AM > To: [EMAIL PROTECTED]; python-list@python.org > Subject: RE: How make regex that means "contains regex#1 but NOT > regex#2" ??

Re: pyparsing problem

2008-07-01 Thread name
Paul McGuire <[EMAIL PROTECTED]> wrote in news:be7af822-70d7-44fb-96fa- [EMAIL PROTECTED]: > > Looks like this is a bug in asXML(). Note that if I reverse the use > and host_name strings in the input and in your grammar, I get this XML > output: > > > host-01 > generic > host alias xyz >

Re: Disabling the magic "last expression" _ variable

2008-07-01 Thread Ben Finney
Peter Otten <[EMAIL PROTECTED]> writes: > >>> import sys > >>> def displayhook(result): > ... if result is not None: > ... __builtins__._last = result > ... print result > ... Better is to explicitly import the name '__builtin__' http://www.python.org/doc/lib/module-bu

Installing paramiko and pycrypto

2008-07-01 Thread cokofreedom
I am really stuck presently, trying to install these on my Windows XP. I have downloaded easy_install and it is now in Python25\Scripts but none of the commands I have read in either program folder have worked to install them. I was hoping someone could give me a step by step guide to installing t

Re: Implementing an 8 bit fixed point register

2008-07-01 Thread Grant Edwards
On 2008-07-01, nickola <[EMAIL PROTECTED]> wrote: > Hello to all > I'm about to write a simulator for a microcontroller in python > (why python? because I love it!!!) > > but I have a problem. > > The registry of this processor are all 8 bit long (and 10 bit > for some other strange register) a

Re: frame grabber hardware

2008-07-01 Thread rubbishemail
> Do you mean something like this? > > Easy Cap Audio-Video Capturing Adapter > http://www.youtube.com/watch?v=3AvT8JQ7NzI this would be suitable, if it had a documented driver, some sites said it could only be used with the included software. many bad comments, though: http://forums.ebay.com/db

Re: pyparsing problem

2008-07-01 Thread Paul McGuire
On Jul 1, 8:02 am, name <[EMAIL PROTECTED]> wrote: > Hi, > > I try to parse a file with pyparsing and get this output: > >     ['generic', 'host-01', 'host alias xyz', '10.0.0.1'] >     - alias: host alias xyz >     - host_name: ['host-01'] >     - ip_address: ['10.0.0.1'] >     - use: ['generic']

RE: How make regex that means "contains regex#1 but NOT regex#2" ??

2008-07-01 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: Tuesday, July 01, 2008 2:29 AM > To: python-list@python.org > Subject: How make regex that means "contains regex#1 but NOT regex#2" > ?? > > I'm looking over the do

Re: Looping-related Memory Leak

2008-07-01 Thread Tom Davis
On Jun 30, 8:24 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Jun 30, 1:55 pm, Tom Davis <[EMAIL PROTECTED]> wrote: > > > > > On Jun 26, 5:38 am, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > On Jun 26, 5:19 am, Tom Davis <[EMAIL PROTECTED]> wrote: > > > > > I am having a problem where a long-runn

Re: Scope and program structure problems

2008-07-01 Thread John Dann
Many thanks for the repsonse - much appreciated. And sorry - yes I was probably compounding two separate issues here - the GUI one and the variable scope one. Maybe the wxPython list would be the best place to ask more about the GUI side of things. Then actually I can simplify my remaining quest

Re: Looping-related Memory Leak

2008-07-01 Thread Tom Davis
On Jun 30, 3:12 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Mon, 30 Jun 2008 10:55:00 -0700, Tom Davis wrote: > > To me, this seems illogical. I can understand that the GC is > > reluctant to reclaim objects that have many connections to other > > objects and so forth, but once th

Re: Embedding Python

2008-07-01 Thread Carsten Haese
Marcin Krol wrote: Hello everyone, I'm trying to embed Python interpreter in C code, but in a specific way: loading compiled bytecode into a memory location and executing it (don't ask why, complicated reasons). PyImport_ExecCodeModule seems like obvious candidate, docs say: "Given a module na

connecting to DBMS

2008-07-01 Thread varun chadha
i am a newbie to python and is working on an application which needs to connect to the database. can anyone guide me through the DBMS that i can use and the module to connect to it. currently i have MySQL installed using the link on the python.org site but is unable to connect to it through python.

Re: C++ or Python

2008-07-01 Thread Maria R
On Jun 28, 12:22 am, Kurda Yon <[EMAIL PROTECTED]> wrote: > I would like to know what are advantages of Python in comparison with C > ++? In which cases and why Python can be a better tool than C++? > > Thank you! Back in 2002, we made a hard decision between c++ (well established here) java (not

Re: problem with exec and locals()

2008-07-01 Thread Mel
rocksportrocker wrote: > > Hi, > > the following code does not work until I ommit the "a=0" statement. > > >def test(): >exec "a=3" in locals() >print a >a=0 > > test() > > print raises: > UnboundLocalError: local variable 'a' referenced before > assignme

Re: [Employment] New TurboGears Job in Eugene, OR

2008-07-01 Thread Aahz
In article <[EMAIL PROTECTED]>, Tim Roberts <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] (Aahz) wrote: >>Paul McNett <[EMAIL PROTECTED]> wrote: >>> >>>They want an expert for a maximum of $25 per hour? If they find someone, >>>it'll be a pretty good bullshitter looking for experience. >> >>Note

  1   2   >