Re: floatref

2010-07-15 Thread Tino Wildenhain
Hi John, Am 15.07.2010 09:14, schrieb John Nagle: On 7/14/2010 12:56 AM, Roald de Vries wrote: I know, I just wondered if there is a *standard* solution. Yes, there is. class floatref(object) : def __init__(self, initialval) : self.__dict__["_val"] = initialval def __getattr__(self, attrname

Re: floatref

2010-07-14 Thread Tino Wildenhain
Am 13.07.2010 19:26, schrieb Roald de Vries: > Hi all, > > I have two objects that should both be able to alter a shared float. > So i need something like a mutable float object, or a float reference > object. Does anybody know if something like that exists? I know it's > not hard to build, but

Re: Free chapter about Python and databases (MySQL and SQLite)

2010-05-28 Thread Tino Wildenhain
Hi, Am 28.05.2010 04:45, schrieb Sebastian Bassi: Hello, I want to announce that the publisher of "Python for Bioinformatis" (CRC Press) allowed me to publish a chapter from my book. I decided to publish the chapter about "Python and databases". I think it may be useful for somebody. The officia

Re: Function that knows its argument's variable name

2010-03-17 Thread Tino Wildenhain
lease note introspective approaches have a very narrow field where they can work - as already shown in other posts: you can have values w/o names and also more then one name to a value (or object). Regards Tino Wildenhain smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Any Python Module to send ring tones from PC to mobile via GSM modem

2010-02-01 Thread Tino Wildenhain
Hi Ganesh, Am 01.02.2010 11:35, schrieb guptha: Hi group, Is there any python module available which sends ring tones from our PC to mobile phone using GSM Modem. I googled in vain to find a solution .I can find few modules like pygsm ,singshotsms by which only sms is send .I could appreciate i

Re: Moving from PHP to Python. Is it Possible

2009-12-12 Thread Tino Wildenhain
MRAB schrieb: > zeph wrote: > [snip] >> 4) It's better to collect all your eventual output into a string that >> you print - there are examples at [3]. You can import from other >> modules as needed (even conditionally), grow your string for output, >> then finally print it like (this example was a

Re: postgresql_autodoc in Python?

2009-12-07 Thread Tino Wildenhain
Am 07.12.2009 15:14, schrieb Jean-Michel Pichavant: Wolfgang Keller wrote: Hello, has anyone ever implemented something similar to postgresql_autodoc in Python? TIA, Sincerely, Wolfgang If by postgresql_autodoc you mean tools for generating html documentation from python code, yes. Starti

Re: Unexpected python exception

2009-11-13 Thread Tino Wildenhain
Am 11.11.2009 15:29, schrieb Richard Purdie: On Wed, 2009-11-11 at 05:04 -0800, Chris Rebert wrote: On Wed, Nov 11, 2009 at 4:37 AM, Richard Purdie wrote: Is there a way to make the "global x" apply to all functions without adding it to each one? Thankfully, no. Hmm :(. What I'm trying

Re: Solved - Python: automate input to MySQL query

2009-09-24 Thread Tino Wildenhain
Hi, ... code, even that is not needed, as the columns are returned in the order specified so code /knows/ that the first column is from /this/ table and the other column with is from /that/ table). Unless you get a dictionary return. In any case, I have a strong philosophical objection to

Re: python module for data comparison of 2 MySQL servers

2009-09-04 Thread Tino Wildenhain
Hi, Am 02.09.2009 02:00, schrieb none: I have 2 MySQL servers in 2 different data centers. Between them, there is data replication setup. Is there a python tool so I can do data comparison for daily records? Why should the data differ and the replication not detect and correct it? I frequentl

Re: Why does this group have so much spam?

2009-09-02 Thread Tino Wildenhain
Am 01.09.2009 22:10, schrieb David: Il Mon, 31 Aug 2009 20:06:54 -0700 (PDT), r ha scritto: ... The system is definitely flawed. I am no internet expert so i don't really know what we could do to fix it. I do fear goverment or corporations taking over of the internet and robbing use of our fre

Re: Python word to text

2009-09-01 Thread Tino Wildenhain
Am 01.09.2009 13:42, schrieb Nitebirdz: On Tue, Sep 01, 2009 at 11:38:30AM +0200, BJörn Lindqvist wrote: Hello everybody, I'm looking for a pure Python solution for converting word documents to text. App Engine doesn't allow external programs, which means that external programs like catdoc and

Re: reading a text file

2009-08-19 Thread Tino Wildenhain
superpollo wrote: hi clp what's the difference between: while True: input_line = sys.stdin.readline() if input_line: sys.stdout.write(input_line.upper()) else: break and: while True: try: sys.stdout.write(sys.stdin.next().upper()) e

Re: xlrd - insert column?

2009-07-28 Thread Tino Wildenhain
LeeRisq wrote: Does xlrd have the capability to insert a column? rd means ReaD, so there is nothing it could insert something to. Of course once you have read the data you can manipulate its structure how you like it. The counterpart is xlwt and it can write excel files however you like it. R

Re: How save clipboard data as bmp file

2009-04-20 Thread Tino Wildenhain
gopal mishra wrote: Hi, I am trying to save my clipboard data (format is CF_ENHMETAFILE) as BitMap file (.BMP). Can any on suggest how to do this. Sure. Open "Paint" press ctrl-v and the save as BMP. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.pyt

Re: print as a function in 2.5 ?

2009-04-19 Thread Tino Wildenhain
Stef Mientki wrote: hello, For several reasons I still use Python version 2.5. I understand that the print-statement will be replaced in Python version 3.0. At the moment I want to extend the print statement with an optional traceback. So I've 2 options: 1- make a new function, like "eprint

Re: Useful MySQL Routines

2009-04-19 Thread Tino Wildenhain
Lawrence D'Oliveiro wrote: In message , Tino Wildenhain wrote: Lawrence D'Oliveiro wrote: I've done a writeup on some of the basic routines I frequently use here <http://codecodex.com/wiki/index.php?title=Useful_MySQL_Routines>. Why is that specific to mysql? Because

Re: Useful MySQL Routines

2009-04-19 Thread Tino Wildenhain
Lawrence D'Oliveiro wrote: I've done a writeup on some of the basic routines I frequently use here . Why is that specific to mysql? Btw, the bulkinserter could be better done by using executemany and select usefull batch sizes. I

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Tino Wildenhain
baykus wrote: Hi I am looking for one of those experimental languages that might be combination of python+basic. Now thta sounds weird and awkward I know. The reason I am asking is that I always liked how I could reference- call certain line number back in the days. It would be interesting to ge

Re: Network game using mysql

2009-04-14 Thread Tino Wildenhain
Hi, João Abrantes wrote: Good evening, I am making an online game that stores its data in a mysql database. The thing is that I can't allow the players to interact directly with the important tables of database (they could cheat if I give them access) so I only allow them to write on a table

Re: video capture in Python ?

2009-04-13 Thread Tino Wildenhain
Hi Stef, Stef Mientki wrote: ... videocapture webcamwatcher opencv libvidcap hdpvrassistent they didn't run at all or they crashed within 10 seconds :-( The most promissing looks videocapture, but that also crashes within 10 seconds. Video capture is not a trivial task. to be more exactly, I

Re: Q:Pythonic way to create list of lists

2009-04-12 Thread Tino Wildenhain
grkunt...@gmail.com wrote: I am just learning Python. I am trying to create a list of empty lists: [[], [], [], ...] (10 items total). Apart from the solutions shown, why would you do that in the first place? Creating such a structure is probably not so pythonic so the way to create it does n

Re: Jython on Google AppEngine.

2009-04-09 Thread Tino Wildenhain
Jason Scheirer wrote: On Apr 9, 9:12 am, Alan Kennedy wrote: Hi all, You may be interested to know that you can now run jython 2.2 out of the box on Google AppEngine, thanks to their new java support. ... Finally! A way to run Python on App Engine! ? Is that some kind of weird humor? :-)

Re: asynchronous python call

2009-04-08 Thread Tino Wildenhain
Hi, joeygartin wrote: Complete newbie, so forgive my improper use of Python terminology. I am working with Django and I have to send off a number of emails after a person has filled out a form. What I want is to make a call that goes off to form and send the emails and redirect the user to ano

Re: HTML Generation

2009-04-03 Thread Tino Wildenhain
Hi Mike, Mike wrote: Hello all, I'm writing a web app and wanted to do some html generation (I really do not like to maintain or write html). I'm thinking of writing a dsl based on the following: def html(): return def a(): return def body(): return That would be writing HT

Re: Python v3 question related to pickle/marshal

2009-03-26 Thread Tino Wildenhain
Detlev Offenbach wrote: Hi, is it possible to marshal or pickle a data structure using Python v3 and unmarshal or unpickle it using Python v2. If it is possible, how do I have to do it. Everything I tried resulted in an EOFError exception upon unmarshalling/unpickling. Could you give the code

Re: Bash-like brace expansion

2009-03-24 Thread Tino Wildenhain
Peter Waller wrote: Okay, I got fed up with there not being any (obvious) good examples of how to do bash-like brace expansion in Python, so I wrote it myself. Here it is for all to enjoy! If anyone has any better solutions or any other examples of how to do this, I'd be glad to hear from them.

Re: get rid of duplicate elements in list without set

2009-03-20 Thread Tino Wildenhain
thomasvang...@gmail.com wrote: You could use: B=list(set(A)).sort() Hope that helps. That would leave a B with value None :-) B=list(sorted(set(A)) could work. smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Use of HTMLparser to change language

2009-03-20 Thread Tino Wildenhain
pranav wrote: On Mar 20, 3:53 pm, Marco Mariani wrote: pranav wrote: I am sure there is a python way of solving this problem. The common sense approach (nothing to do with python) would be to rewrite everything to be dynamically generated with a template language - in python those would be TA

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tino Wildenhain
venutaurus...@gmail.com wrote: On Mar 20, 1:58 pm, Tino Wildenhain wrote: venutaurus...@gmail.com wrote: Hello all, ... smime.p7s 4KViewDownload Thanks for your suggestion. By the way the attachment which have added has some unknown file extension. May I know how can I view it? This is

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tino Wildenhain
Tim Golden wrote: ... and do the following: from winsys import fs for f in fs.flat ("c:/temp"): f.dump () ^ eeek! But btw, what extra information would it give? Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-

Re: locate items in matrix (index of lists of lists)

2009-03-20 Thread Tino Wildenhain
Alexzive wrote: Hello there, let's suppose I have the following matrix: mat = [[1,2,3], [3,2,4], [7,8,9], [6,2,9]] where [.. , .. , ..] are the rows. I am interested into getting the "row index" of all the matrix rows where a certain number occurs. For example for 9 I should get 2 and 3 (star

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tino Wildenhain
venutaurus...@gmail.com wrote: Hello all, Is there any way to list out all the properties (name, type, size) and attributes( Accesstime, mod time, archived or readonly etc) of a folder and its contents recursively. Should I need ot go inside each and every directory to list them? This

Re: cross compile Python to Linux-ARM

2009-03-19 Thread Tino Wildenhain
jefm wrote: Hi, We are looking to use Python on an embedded Linux ARM system. What I gather from googling the subject is that it is not that straight forward (a fair amount of patching & hacking). Nobody out there that has done it claims it is easy, which makes me worried. Yes unfortunately its

Re: Style formating of multiline query, advise

2009-03-18 Thread Tino Wildenhain
John Machin wrote: On Mar 18, 11:25 pm, someone wrote: Hi, what is good :) style for multiline queries to database? Is that one ok? query = """ SELECT * FROM ( SELECT a.columna, a.columnb, a.iso FROM all a WHERE (a.name = LOWER(%s)

Re: REDIRECT

2009-03-18 Thread Tino Wildenhain
gaeasian...@gmail.com wrote: Hi ! I'm new to Python. I'm having some difficulties to redirect the pages using python. Every time when I redirect, the URL changed accordingly. (Example : from http://localhost: to http://localhost/hello.py?name='J') What's the Python way of implementin

Re: split problem if the delimiter is inside the text limiter

2009-03-18 Thread Tino Wildenhain
rewonka wrote: Hi, I had a problem, i would like to process a file into a PSQL, but in the file the delimiter char is ':' and i have the same charater inside the text field also. something like this: text = 1:23:34:"sample: text":" something" if I use text.split(':') it will be ['1', '23', '34',

Re: Neatest way to do a case insensitive "in"?

2009-03-14 Thread Tino Wildenhain
tinn...@isbd.co.uk wrote: ... But I was wondering if there's a neater/easier way? How is "if stringA.lower() in stringB.lower():" complex/messy? Well I guess I was just looking for "incase" a bit like "strcasecmp" in C. Which locales case folding do you want to have applied? Tino smime.p

Re: Get pixel colors from images in Python 3

2009-03-14 Thread Tino Wildenhain
Daniel Fetchinson wrote: I've noticed that Pygame has some similar implementation. It's a little harder to use, but efficient. And i think it depends on PIL too. And Pygame is Python 2.x too... ... When I asked about it there I was told that some work already has started on porting PIL to py

Re: Can Python do shopping cart?

2009-03-07 Thread Tino Wildenhain
Muddy Coder wrote: Hi Folks, I know PHP can do shopping cart, such as Zen Cart. I wonder can Python do such a thing? Thanks! No, python cannot "do" that. I also doubt there are many other computer languages, much less PHP that can "do" that. You or somebody else has to write the code - but of

Re: Inverse of dict(zip(x,y))

2009-03-06 Thread Tino Wildenhain
Andre Engels wrote: On Thu, Mar 5, 2009 at 7:46 PM, Andre Engels wrote: If the dict = {key1: val1, key2: val2, ...}, you can do: for key in dict: plot(key,dictionary[key]) Of course I meant: for key in dict: plot(key,dict[key]) Which would be the verbose form of: for x,y in data

Re: Inverse of dict(zip(x,y))

2009-03-06 Thread Tino Wildenhain
Hi, psykeedelik wrote: On Mar 5, 6:01 pm, Tino Wildenhain wrote: Piet van Oostrum wrote: Andre Engels (AE) wrote: AE> On Wed, Mar 4, 2009 at 11:02 AM, lone_eagle wrote: Can someone suggest a easy method to do the inverse of dict(zip(x,y)) to get two lists x and y? So, if x and y are

Re: Inverse of dict(zip(x,y))

2009-03-06 Thread Tino Wildenhain
Andre Engels wrote: On Thu, Mar 5, 2009 at 6:01 PM, Tino Wildenhain wrote: Still I'd like to see an application where this really matters (that keys() and values() match in order) I think there are many such applications, but also that in each of those cases it's a mis-prog

Re: While loop

2009-03-05 Thread Tino Wildenhain
Hi, Fab86 wrote: Hello, I am currently working on my program which send queries to Yahoo and then saves them into a flatfile. The problem I have is that I need to conduct 200 searches and Yahoo typically times out during the search with an error. I have caught the error and told it to time.slee

Re: Inverse of dict(zip(x,y))

2009-03-05 Thread Tino Wildenhain
Piet van Oostrum wrote: Andre Engels (AE) wrote: AE> On Wed, Mar 4, 2009 at 11:02 AM, lone_eagle wrote: Can someone suggest a easy method to do the inverse of dict(zip(x,y)) to get two lists x and y? So, if x and y are two lists, it is easier to make a dictionary using d = dict(zip(x,y)),

Re: Question about binary file reading

2009-03-04 Thread Tino Wildenhain
Benjamin Peterson wrote: John Machin lexicon.net> writes: On Mar 5, 12:13 pm, Benjamin Peterson wrote: import binascii print binascii.hexlify(some_bytes) AFAICT binascii.hexlify(some_bytes) gives the SAME result as some_bytes.encode("hex") for much more typing -- I see no "better" here. So

Re: Question about binary file reading

2009-03-04 Thread Tino Wildenhain
Rhodri James wrote: On Wed, 04 Mar 2009 22:58:38 -, vibgyorbits wrote: I'm writing a tool to do some binary file comparisons. I'm opening the file using fd=open(filename,'rb') # Need to seek to 0x80 (hex 80th) location fd.seek(0x80) # Need to read just 8 bytes and get the result back i

Re: Inverse of dict(zip(x,y))

2009-03-04 Thread Tino Wildenhain
Lie Ryan wrote: Andre Engels wrote: y = d.values() might also work, but I am not sure whether d.keys() and d.values() are guaranteed to use the same order. If they were called immediately after each other I think they should, but better not rely on it. otoh, I could not think of any use hav

Re: Inverse of dict(zip(x,y))

2009-03-04 Thread Tino Wildenhain
lone_eagle wrote: Hi all, This might be trivial ... Can someone suggest a easy method to do the inverse of dict(zip(x,y)) to get two lists x and y? So, if x and y are two lists, it is easier to make a dictionary using d = dict(zip(x,y)), but if I have d of the form, d = {x1:y1, x2:y2, ...}, wh

Re: String Identity Test

2009-03-04 Thread Tino Wildenhain
, you could profit from identity and the overhead of installing it would be neglectable (and you can force this in python with "internal") but in this case I'd think calculating and working with a hash instead should be preferred. Regards Tino Wildenhain smime.p7s Description: S

Re: Perl-python regex-performance comparison

2009-03-03 Thread Tino Wildenhain
Ivan wrote: Hello everyone, ... 1. Although it is all relatively similar, there are differences between regexes of these two. Which do you believe is the more powerful variant (maybe an example) ? 2. They are both interpreted languages, and I can't really be sure how they measure in speed. I

Re: Email Program

2009-03-02 Thread Tino Wildenhain
Hi, Dennis Lee Bieber wrote: On Sat, 28 Feb 2009 17:50:35 -0800 (PST), J declaimed the following in gmane.comp.python.general: Is it possible to make a GUI email program in Python that stores emails, composes, ect? What is "ect"? The latin phrase is "et cetera" -- roughly translated

Re: Email Program

2009-03-01 Thread Tino Wildenhain
J wrote: Is it possible to make a GUI email program in Python that stores emails, composes, ect? Yes this is possible. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Python dictionary size/entry limit?

2009-02-21 Thread Tino Wildenhain
intellimi...@gmail.com wrote: I wrote a script to process textual data and extract phrases from them, storing these phrases in a dictionary. It encounters a MemoryError when there are about 11.18M keys in the dictionary, and the size is about 1.5GB. I tried multiple times, and the error occurs ev

Re: print string as raw string

2009-02-17 Thread Tino Wildenhain
Mirko Dziadzka wrote: Hi all I'm trying to find a way to output strings in the raw-string format, e.g. print_as_raw_string(r"\.") should output r"\." instead of "\\." Is there a better way than writing your own print function? Some magic encoding? Thats nonsense. print r"\." or in python3.0

Re: Pythonic way to determine if a string is a number

2009-02-15 Thread Tino Wildenhain
Roy Smith wrote: In article , Mel wrote: Christian Heimes wrote: Roy Smith wrote: They make sense when you need to recover from any error that may occur, possibly as the last resort after catching and dealing with more specific exceptions. In an unattended embedded system (think Mars Rover)

Re: Pythonic way to determine if a string is a number

2009-02-15 Thread Tino Wildenhain
Python Nutter wrote: Type casting seems to be the wrong way to go about this. teststring = '15719' teststring.isdigit() returns True Actually its instantiating not type casting and it works by using the type's actual description of the data it accepts. This looks pretty good approach instead o

Re: hist without plotting

2009-02-15 Thread Tino Wildenhain
Nick Matzke wrote: Hi, Is there a way to run the numpy hist function or something similar and get the outputs (bins, bar heights) without actually producing the plot on the screen? (R has a plot = false option, something like this is what I'm looking for...) something like scipy.histogram

Re: Python interface to ODF documents?

2009-02-15 Thread Tino Wildenhain
Hi, Dotan Cohen wrote: Is there a Python interface to ODF documents? I'm thinking of something that will import, for example, an ADS spreadsheet into a multidimensional array (including formulas and formatting) and let me manipulate it, then save it back. Yes, you have zipfile and a host of xm

Re: PySerial "write" should accept "bytearray"

2009-02-14 Thread Tino Wildenhain
John Nagle wrote: PySerial, which is basically a binary input/output system, is still requiring "str" instead of "bytearray", even under Python 2.6. For "file-like objects", "write" functions are supposed to accept "bytearray" now, and "read" functions should return a "bytearray". I'm sure pa

Re: urllib2.Request:: http Request sending successfully, but Response contains in valid data.

2009-02-11 Thread Tino Wildenhain
Hi, nRk wrote: Hi I am trying to send Data to a website through "http" using "urllib.request" library using the bellow code. Response status code contains. 200 (OK) but Response contains nothing... With same data When I test using C# it working fine.. Response having.. some data in xml format.

Re: Using paramiko rsa key

2009-02-10 Thread Tino Wildenhain
loial wrote: I want to connect via ssh from a python script on windows to an AIX server running openSSH using rsa keys rather than a password. Can anyone provide me with /point me at a simple tutuorial on the steps I need to go though in terms of geneerating the key, installing on the server an

Re: python ssh and Tetia SSH server

2009-02-10 Thread Tino Wildenhain
loial wrote: Anyone out there any experience of using python ssh modules to connect to the Tetia SSH server from SSH (ssh.com)? Did you call their support? Personally I see no reason why paramiko http://www.lag.net/paramiko/ should not work, given that openssh ssh client also worked in the past

Re: convert the ip packet to and from RS-232 packet

2009-02-09 Thread Tino Wildenhain
Hi, Li Han wrote: Hi, I need to use radio to connect two local ip network, each local network has a server computer which connects to a radio with RS-232 interface. I need to write a program to convert the local ip packet into RS-232 packet, so the radio can send packetes to the remote radio. I

Re: Question on Strings

2009-02-06 Thread Tino Wildenhain
Hi, Kalyankumar Ramaseshan wrote: Hi, Excuse me if this is a repeat question! I just wanted to know how are strings represented in python? It depents on if you mean python2.x or python3.x - the model changed. Python 2.x knows str and unicode - the former a sequence of single byte character

Re: Fastest database solution

2009-02-06 Thread Tino Wildenhain
Hi Curt, Curt Hash wrote: I'm writing a small application for detecting source code plagiarism that currently relies on a database to store lines of code. The application has two primary functions: adding a new file to the database and comparing a file to those that are already stored in the

Re: Comparing two book chapters (text files)

2009-02-05 Thread Tino Wildenhain
andrew cooke wrote: On Feb 4, 10:20 pm, Nick Matzke wrote: So I have an interesting challenge. I want to compare two book chapters, which I have in plain text format, and find out (a) percentage similarity and (b) what has changed. no idea if it will help, but i found this yesterday - http:/

Re: Use list name as string

2009-02-05 Thread Tino Wildenhain
Hendrik van Rooyen wrote: > "MRAB" wrote: > >> The actual names of the variables and functions shouldn't matter to the >> outside world; the name of an output file shouldn't depend on the name >> of a variable. > > That is a matter of opinion. > It is however, an interesting problem, namely: > >

Re: Use list name as string

2009-02-05 Thread Tino Wildenhain
Hi, Vincent Davis wrote: Sorry for not being clear I would have something like this x = [1, 2, 3,5 ,6 ,9,234] Then def savedata(dataname): .. savedata(x) this would save a to a file called x.csv This is my problem, getting the name to be x.csv which is the same as the name of the lis

Re: len()

2009-02-04 Thread Tino Wildenhain
Marco Mariani wrote: Pat wrote: Why didn't you answer the len() question? It's a bit of a FAQ: len() cannot be a method of list objects because it works on any sequence or iterable. Thats only half of the truth :-) len() can use some internal optimizations on certain objects where sequenc

Re: Locating python

2009-02-04 Thread Tino Wildenhain
andrew cooke wrote: On Feb 4, 9:16 am, andrew cooke wrote: actually "su" needs the root (or the target users') password and sudo needs _your_ (the current users) password. argh, sorry for the confusion. actually, no. sudo requires the root password. at least on opensuse 11.1 default config

Re: Locating python

2009-02-04 Thread Tino Wildenhain
andrew cooke wrote: On Feb 3, 7:35 pm, David Sevilla wrote: I am quite new to Linux, and thought that by using yast2 there would be no user problems (I am asked for the root password). I will sudo it to see if it solves the problem. yast asked you for the password so that easy_install could b

Re: Python ssh with SSH Tectia server

2009-02-03 Thread Tino Wildenhain
Hi, loial wrote: Has anyone any experiencing with ssh between a python client and the SSH Tectia server from SSH (ssh.com) ? this might well be. ;) Does it work? Did you try? (It should however since at least openssh client worked) Cheers Tino smime.p7s Description: S/MIME Cryptographi

Re: Unzipping a .zip properly, and from a remote URL

2009-02-03 Thread Tino Wildenhain
Christopher Culver wrote: Tino Wildenhain writes: so instead you would use archive = zipfile.ZipFile(remotedata) That produces the following error if I try that in the Python interpreter (URL edited for privacy): import zipfile import urllib2 remotedata = urllib2.urlopen("

Re: Unzipping a .zip properly, and from a remote URL

2009-02-03 Thread Tino Wildenhain
Hi, Christopher Culver wrote: Returning to Python after several years away, I'm working on a little script that will download a ZIP archive from a website and unzip it to a mounted filesystem. The code is below, and it works so far, but I'm unsure of a couple of things. The first is, is there a

Re: key capture

2009-02-02 Thread Tino Wildenhain
Hi, swamynathan wrote: hello, im making a virtual piano in python where on key stroke a wav is played from a location now to implement a fully functional piano i need to have multiple key stroke captures ie if 2 or 3 keys pressed then the function which playes the wav is called with 3 param

Re: is python Object oriented??

2009-01-29 Thread Tino Wildenhain
Muriel de Souza Godoi wrote: Python offers support for object orientation, but it's not an object-oriented language. I mean, you can code a entire program in Python with no classes. So you use it if you want to. It's not like java, which you must use a class to code a Hello World, but Java is

Re: Results of executing hyperlink in script

2009-01-28 Thread Tino Wildenhain
Tim Chase wrote: 1. This method was suggested by Cameron Laird: os.system("start %s" % URL) It works. But, if the URL contains character &, it will fail. For As an aside, the START command is a bit picky regarding quotes. You have to use this horrible contortion os.system('start "

Re: USB in python

2009-01-27 Thread Tino Wildenhain
Hi, Astan Chee wrote: Diez B. Roggisch wrote: If all you need is on-off - why can't you just use a switch? Because I want to control the on-off the device using a computer and write software for it (which I am confident I can do if I had references to how the wrappers to said inte

Re: USB in python

2009-01-22 Thread Tino Wildenhain
Astan Chee wrote: Hi, Im trying to write a program for my USB device and I'm thinking of using python to do this. The USB device is of my own making and it is activated when one of the two data pins of the USB is given about 5V (or similar to whatever the power pin is getting). Now I'm confuse

Re: How to print lambda result ?

2009-01-20 Thread Tino Wildenhain
a class is supposed to return when its __str__() is called. Default is what you see. (this is actually __str__() returning __repr__() which is at its default) Regards Tino -Original Message----- From: Tino Wildenhain [mailto:t...@wildenhain.de] Sent: Tuesday, January 20, 2009 14:22 To: Bar

Re: How to print lambda result ?

2009-01-20 Thread Tino Wildenhain
Hi, Barak, Ron wrote: Hi, Wanting to print the correct plural after numbers, I did the following: for num in range(1,4): string_ = "%d event%s" % (num,lambda num: num > 1 and "s" or "") print string_ However, instead of getting the expected output: 1 event 2 events 3 events I get:

Re: psycopg2 weirdness

2009-01-17 Thread Tino Wildenhain
Neha Gupta wrote: Hey, ... crs_dep_hour, origin from flightdata where date = '" + date + "' group ^^^ never ever do that! Even more when input comes from user. The correct form is cur.exec("... date = %s group by ...",(date,)) ple

Re: reading file to list

2009-01-17 Thread Tino Wildenhain
MRAB wrote: Tino Wildenhain wrote: Xah Lee wrote: comp.lang.lisp,comp.lang.scheme,comp.lang.functional,comp.lang.python,comp.lang.ruby ... OK, I want to create a nested list in Lisp (always of only integers) from a text file, such that each line in the text file would be represented as a

Re: reading file to list

2009-01-17 Thread Tino Wildenhain
Xah Lee wrote: comp.lang.lisp,comp.lang.scheme,comp.lang.functional,comp.lang.python,comp.lang.ruby ... OK, I want to create a nested list in Lisp (always of only integers) from a text file, such that each line in the text file would be represented as a sublist in the 'imported' list. example

Re: image recogniton?

2009-01-06 Thread Tino Wildenhain
Hi, Furkan Kuru wrote: start with Python Image Library: http://www.pythonware.com/products/pil/ I think this is more a job for OpenCV and its python bindings. http://opencv.willowgarage.com/wiki/PythonInterface On Tue, Jan 6, 2009 at 4:28 PM, Li Han > wrote:

Re: Ideas to optimize this getitem/eval call?

2009-01-04 Thread Tino Wildenhain
mario wrote: On Jan 3, 7:16 am, Steven D'Aprano wrote: I was about to make a comment about this being a security hole, Strange that you say this, as you are also implying that *all* the widely-used templating systems for python are security holes... Well, you would be right to say that of co

Re: ACL in python

2009-01-03 Thread Tino Wildenhain
John Boloshevich wrote: Hello, does anybody know about an ACL implementation for python, which is not tied to the filesystem? I would like to use ACL on different objects not on files, so the POSIX file access solution is not the one I am looking for. You mean something like the restricted e

Re: Switching user in a SSH connection

2009-01-02 Thread Tino Wildenhain
Shah Sultan Alam wrote: Hi Group, I am trying to connect to a Linux maching using paramiko. and able to run a command like "ls -l" Now I want to switch user being in the connection ( eg running something like "su -" ) Will you please let me know how to do that. You would for example run su

Re: Parsing Excel spreadsheets

2008-12-30 Thread Tino Wildenhain
r wrote: On Dec 30, 10:07 am, "andyh...@gmail.com" wrote: Hi, Can anybody recommend an approach for loading and parsing Excel spreadsheets in Python. Any well known/recommended libraries for this? The only thing I found in a brief search washttp://www.lexicon.net/sjmachin/xlrd.htm, but I'd r

Re: math module for Decimals

2008-12-29 Thread Tino Wildenhain
jerry.carl...@gmail.com wrote: ... It's really just the goniometric functions that I am missing most at the moment, so maybe I can figure it out with help of what you said plus the already existing imperfect modules. Meantime maybe this discussion will caught Guido's eye... ;-) And btw I do expec

Re: Windows SSH (remote execution of commands) - Python Automation

2008-12-29 Thread Tino Wildenhain
Hi, Narasimhan Raghu-RBQG84 wrote: Hi experts, I am looking for some information on how to automate remote login to a UNIX machine using ssh from a windows XP box. Possible way: 1. Use putty (or any other ssh client from windows XP). -- Can be automated with command line parameters. The

Re: Can´t Surf Python Pages in Windoz e

2008-12-26 Thread Tino Wildenhain
hi, Victor Subervi wrote: Hi; I try to surf to this code in Windoze and it doesn't work...just posts a small, black screen for a split second. Why? I don't know what "surf this code" means (or what Windoze should be) print "Content-Type: text/html" print print """ "http://www.w3.org/TR/xht

Re: How to represent a sequence of raw bytes

2008-12-21 Thread Tino Wildenhain
Steven Woody wrote: On Mon, Dec 22, 2008 at 10:27 AM, Michiel Overtoom wrote: On Monday 22 December 2008 03:23:03 Steven Woody wrote: 2. char buf[] = {0x11, 0x22, 0x33, ... } What's the equivalent representation for above in Python? buf="\x11\x22\33" ... I thing "\x11\x22\x33" in python

Re: Are Django/Turbogears too specific?

2008-12-21 Thread Tino Wildenhain
Philip Semanchuk wrote: ... I prefer Mako over the other template languages I've seen. From what I can tell Mako is nearly identical to all other template languages you might have seen (e.g. PHP style tags). Thats why I personally would not consider it. Its just much of a hassle to mix code an

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Tino Wildenhain
Neal Becker wrote: ... So if __str__ is "meant for human eyes", then why isn't print using it! it is: > print x str but dict just uses repr() for all its childs to print. T. That makes no sense to me. If I call 'print' on a container, why wouldn't it recursively print on the contained ob

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Tino Wildenhain
Neal Becker wrote: Reading some FAQ, I see that __str__ is "meant for human eyes". But it seems that: class X(object): def __str__(self): return "str" def __repr__(self): return "repr" x = X() d = {0 : x} print d {0: repr} So if __str__ is "meant for human eyes", then w

Re: regex problem ..

2008-12-15 Thread Tino Wildenhain
Analog Kid wrote: Hi All: I am new to regular expressions in general, and not just re in python. So, apologies if you find my question stupid :) I need some help with forming a regex. Here is my scenario ... I have strings coming in from a list, each of which I want to check against a regular

Re: zip a created file

2008-12-13 Thread Tino Wildenhain
frendy zhang wrote: > if form.accepts(request.vars,session): > for table in db.tables: > rows=db(db[table].id).select() > print rows > open(str(os.sep).join([os.getcwd(), 'applications', > request.application, 'databases', >

Re: python to parse excel file csv format

2008-12-03 Thread Tino Wildenhain
MRAB wrote: Jay Jesus Amorin wrote: This is how i do it, but it runs with error. Kindly help #!/usr/bin/env python import csv, sys, os filename = (sys.argv[1]) reader = csv.reader(open(filename, "rb"), delimiter=',', quoting=csv.QUOTE_NONE) try: for row in reader: o

  1   2   >