Re: Do this as a list comprehension?

2008-06-08 Thread Mensanator
On Jun 8, 9:40 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Jun 8, 3:19�am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > >> "Mensanator" <[EMAIL PROTECTED]> wrote in message > > >>news:[EMAIL PROTECTED] > >> | On Jun 7, 6:43?pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > >>

Re: Newbie help (TypeError: int argument required)

2008-06-08 Thread bukzor
On Jun 8, 11:43 am, Iain Adams <[EMAIL PROTECTED]> wrote: > Hi, > > I am new to python. I have been having trouble using the MysqlDB. I > get an error pointing from the line > > cursor.execute("UPDATE article SET title = %s, text = %s WHERE id = > %u", (self.title, self.text, self.id)) > > Here is

Re: Q re documentation Python style

2008-06-08 Thread bukzor
On Jun 8, 2:17 pm, kj <[EMAIL PROTECTED]> wrote: > I'm a Perlhead trying to learn the Way of Python.  I like Python > overall, but every once in a while I find myself trying to figure > out why Python does some things the way it does.  At the moment > I'm scratching my head over Python's docstrings

Re: need help with timezone conversion (unexpected side effect of time.mktime ??)

2008-06-08 Thread Ivan Velev
Thanks Paul, I have identified the "problem" - because of daylight change this particular timesamp was observed twice in Europe/Sofia. Here is the GMT-to-local-time conversion: ++-+-+ | gmt_stamp | gmt_time| local_time | +

Re: Distributing applications that use 3rd party modules

2008-06-08 Thread eliben
On May 17, 11:42 am, eliben <[EMAIL PROTECTED]> wrote: > Hello, > > I'm getting into Python now after years of Perl, and as part of my > research I must understand how to do some common tasks I need. > > I have a bunch of Windows PCs at work to which I want to distribute an > application I've devel

Re: How to get full path to script?

2008-06-08 Thread bukzor
On Jun 8, 12:52 pm, kj <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]> "Mark Tolonen" <[EMAIL PROTECTED]> writes: > > >import os > >print os.path.abspath(__file__) > > Great.  Thanks! > > Kynn > > -- > NOTE: In my address everything before the first period is backwards; > and the last period, a

Re: time.clock() or Windows bug?

2008-06-08 Thread Tim Roberts
Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > >time.clock() uses QueryPerformanceCounter under windows. There are >some known problems with that (eg with Dual core AMD processors). > >See http://msdn.microsoft.com/en-us/library/ms644904.aspx > >And in particular > >On a multiprocessor computer,

Re: import cherrypy2

2008-06-08 Thread Tim Roberts
luca72 <[EMAIL PROTECTED]> wrote: > >No i haven't install lino > >but if frmp the python of this computer i make import cherrypy2 i >import it without problem this is the python path: It's quite possible that this other system has both CherryPy 2.x and CherryPy 3.x installed, and the admin wanted

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

2008-06-08 Thread Patrick Mullen
"Well, "common" in Prolog, Smalltalk, Haskell, ML, and Erlang is hardly common in general. I'll bet that Java and C/C++ are used more in North Dakota than all those languages combined are used in the entire world." I would say python has more in common with the mentioned family than with the C or

deleting objects by finding all references and deleting?

2008-06-08 Thread Jacob Davis
Hi, I read in some earlier messages that an object in Python is only removed or freed from memory when all references to that object have been deleted. Is this so? If so, is there a way to get all of the references to an object, so that they may all be deleted, thus actually deleting the

Re: sendKey

2008-06-08 Thread Steve McKay
Gandalf wrote: I found some script that send keys , But I couldn't manage to send CTRL+c with none of them can any one tell me what i'm doing wrong: import win32api import win32com.client shell = win32com.client.Dispatch("WScript.Shell") shell.Run("Notepad") win32api.Sleep(100) shell.AppActiv

Re: How to close app after x seconds.

2008-06-08 Thread CM
On Jun 8, 8:51 pm, ralphz <[EMAIL PROTECTED]> wrote: > Hi > > I have small app that I want to close tself after x seconds. Basically > start show some message and close. > > I come up with something like this but it does not work. Can anyone help > me with it? > > #!/usr/bin/env python > > import w

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

2008-06-08 Thread John Salerno
Sh4wn wrote: data hiding. I know member vars are private when you prefix them with 2 underscores, but I hate prefixing my vars, I'd rather add a keyword before it. Others touched on this, but I thought I'd throw it in here as well since I was just reading about this. Apparently the double und

Re: Do this as a list comprehension?

2008-06-08 Thread John Salerno
Mensanator wrote: On Jun 8, 3:19�am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: "Mensanator" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Jun 7, 6:43?pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: | > zip(range(9,20), iterable) | | Oh, dear. You didn't actually try this,

How to close app after x seconds.

2008-06-08 Thread ralphz
Hi I have small app that I want to close tself after x seconds. Basically start show some message and close. I come up with something like this but it does not work. Can anyone help me with it? #!/usr/bin/env python import wx import time class MyFrame(wx.Frame): def __init__(self, tit

Re: Q re documentation Python style

2008-06-08 Thread Paddy
On Jun 8, 10:17 pm, kj <[EMAIL PROTECTED]> wrote: > I'm a Perlhead trying to learn the Way of Python. I like Python > overall, but every once in a while I find myself trying to figure > out why Python does some things the way it does. At the moment > I'm scratching my head over Python's docstring

Re: Q re documentation Python style

2008-06-08 Thread Scott David Daniels
kj wrote: ... I want to document a function that takes a dictionary as argument, and this dictionary is expected to have 5 keys. When the number of mandatory > arguments gets above 4, I find that it's too difficult to remember > their order, so I resort to using a dictionary as the single argu

Re: sendKey

2008-06-08 Thread Kam-Hung Soh
Gandalf wrote: I found some script that send keys , But I couldn't manage to send CTRL+c with none of them can any one tell me what i'm doing wrong: import win32api import win32com.client shell = win32com.client.Dispatch("WScript.Shell") shell.Run("Notepad") win32api.Sleep(100) shell.AppActiv

Re: Q re documentation Python style

2008-06-08 Thread John Machin
On Jun 9, 7:17 am, kj <[EMAIL PROTECTED]> wrote: [snip] > For example, I want to document a function that > takes a dictionary as argument, and this dictionary is expected to > have 5 keys. (When the number of mandatory arguments gets above > 4, I find that it's too difficult to remember their or

Re: Q re documentation Python style

2008-06-08 Thread Carl Banks
On Jun 8, 5:17 pm, kj <[EMAIL PROTECTED]> wrote: > I'm a Perlhead trying to learn the Way of Python. Welcome to the light, my son. > I guess this is a rambling way to ask: are docstrings *it* as far > Python documentation goes? Or is there a second, more flexible > system? You can define a de

Re: Python is slow

2008-06-08 Thread Baris-C
On May 22, 7:14 pm, cm_gui <[EMAIL PROTECTED]> wrote: > Python is slow.    Almost all of the web applications written in > Python are slow.   Zope/Plone is slow, sloow, so very slooow.  Even > Google Apps is not faster.   Neither is Youtube. > Facebook and Wikipedia (Mediawiki), written in PHP, are

Re: Q re documentation Python style

2008-06-08 Thread Timothy Grant
On Sun, Jun 8, 2008 at 2:17 PM, kj <[EMAIL PROTECTED]> wrote: > > > I'm a Perlhead trying to learn the Way of Python. I like Python > overall, but every once in a while I find myself trying to figure > out why Python does some things the way it does. At the moment > I'm scratching my head over P

Re: Q re documentation Python style

2008-06-08 Thread Diez B. Roggisch
I guess this is a rambling way to ask: are docstrings *it* as far Python documentation goes? Or is there a second, more flexible system? Docstrings are it. Yet there are several ways how their content is interpreted. Google for example epydoc. You can embed links that way. I don't know perl,

Q re documentation Python style

2008-06-08 Thread kj
I'm a Perlhead trying to learn the Way of Python. I like Python overall, but every once in a while I find myself trying to figure out why Python does some things the way it does. At the moment I'm scratching my head over Python's docstrings. As far as I understand this is the standard way to d

Re: time.clock() or Windows bug?

2008-06-08 Thread Theo v. Werkhoven
The carbonbased lifeform Nick Craig-Wood inspired comp.lang.python with: > Theo v. Werkhoven <[EMAIL PROTECTED]> wrote: >> Output: >> Sample 1, at 0.0 seconds from start; Output power is: 8.967 dBm > [snip] >> Sample 17, at 105.7 seconds from start; Output power is: 9.147 dBm >> Sample 18, at 1

Re: Newbie help (TypeError: int argument required)

2008-06-08 Thread [EMAIL PROTECTED]
On Jun 8, 1:43 pm, Iain Adams <[EMAIL PROTECTED]> wrote: > Hi, > > I am new to python. I have been having trouble using the MysqlDB. I > get an error pointing from the line > > cursor.execute("UPDATE article SET title = %s, text = %s WHERE id = > %u", (self.title, self.text, self.id)) > > Here is t

Re: How to get full path to script?

2008-06-08 Thread kj
In <[EMAIL PROTECTED]> "Mark Tolonen" <[EMAIL PROTECTED]> writes: >import os >print os.path.abspath(__file__) Great. Thanks! Kynn -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded. -- http://mail.python.or

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

2008-06-08 Thread Russ P.
On Jun 8, 5:40 am, Mark Wooding <[EMAIL PROTECTED]> wrote: > Russ P. <[EMAIL PROTECTED]> wrote: > > The idea of being able to discern properties of an object by its name > > alone is something that is not normally done in programming in > > general. > > Really? You obviously haven't noticed Prolog

Re: Need help porting Perl function

2008-06-08 Thread Vlastimil Brom
2008/6/7, kj <[EMAIL PROTECTED]>: > > > > ... The original Perl function takes a reference to an array, removes > from this array all the elements that satisfy a particular criterion, > > and returns the list consisting of the removed elements. ... > > > > Just out of curiosity, as I didn't find an

Re: time.clock() or Windows bug?

2008-06-08 Thread Nick Craig-Wood
Theo v. Werkhoven <[EMAIL PROTECTED]> wrote: > In this code I read out an instrument during a user determined period, > and save the relative time of the sample (since the start of the test) > and the readback value in a csv file. > > from datetime import * > from time import * > from visa i

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

2008-06-08 Thread Russ P.
On Jun 8, 5:52 am, Mark Wooding <[EMAIL PROTECTED]> wrote: > By enforcing your `data hiding', you're effectively telling me that I'm > too stupid to make rational decisions of this sort. And that's actually > extremely insulting. 1) I suggest you not take it personally. 2) Local data within fun

PERSONAL BANKRUPTCY

2008-06-08 Thread PREETHI
http://onenesstemplenemam.blogspot.com http://bankruptcy5.blogspot.com/ http://filingbankruptcy1.blogspot.com/ http://bankruptcyattorney1.blogspot.com/ http://personalbankruptcy1.blogspot.com/ http://chapter13bankruptcy1.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get full path to script?

2008-06-08 Thread Mark Tolonen
"kj" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] How can a script know its absolute path? (__file__ only gives the path it was used to invoke the script.) Basically, I'm looking for the Python equivalent of Perl's FindBin. The point of all this is to make the scripts locat

Newbie help (TypeError: int argument required)

2008-06-08 Thread Iain Adams
Hi, I am new to python. I have been having trouble using the MysqlDB. I get an error pointing from the line cursor.execute("UPDATE article SET title = %s, text = %s WHERE id = %u", (self.title, self.text, self.id)) Here is the error: line 56, in save cursor.execute("UPDATE article SET titl

Re: How to get full path to script?

2008-06-08 Thread Benjamin Kaplan
On Sun, Jun 8, 2008 at 1:03 PM, kj <[EMAIL PROTECTED]> wrote: > > > > How can a script know its absolute path? (__file__ only gives the > path it was used to invoke the script.) > > Basically, I'm looking for the Python equivalent of Perl's FindBin. > > The point of all this is to make the script

How to get full path to script?

2008-06-08 Thread kj
How can a script know its absolute path? (__file__ only gives the path it was used to invoke the script.) Basically, I'm looking for the Python equivalent of Perl's FindBin. The point of all this is to make the scripts location the reference point for the location of other files, as part of a

Re: Need help porting Perl function

2008-06-08 Thread kj
In <[EMAIL PROTECTED]> kj <[EMAIL PROTECTED]> writes: >In <[EMAIL PROTECTED]> John Machin <[EMAIL PROTECTED]> writes: >>It's nothing to do with list comprehensions, which are syntactical >>sugar for traditional loops. You could rewrite your list comprehension >>in the traditional manner... >>and

Re: Need help porting Perl function

2008-06-08 Thread kj
In <[EMAIL PROTECTED]> John Machin <[EMAIL PROTECTED]> writes: >It's nothing to do with list comprehensions, which are syntactical >sugar for traditional loops. You could rewrite your list comprehension >in the traditional manner... >and it would still fail for the same reason: mutating the list o

Re: Do this as a list comprehension?

2008-06-08 Thread Mensanator
On Jun 8, 4:04 am, Lie <[EMAIL PROTECTED]> wrote: > On Jun 8, 8:56 am, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > > > On Jun 7, 8:22�pm, John Salerno <[EMAIL PROTECTED]> wrote: > > > > Mensanator wrote: > > > > What I DID say was that how the builtins actually > > > > work should be understood

Re: Do this as a list comprehension?

2008-06-08 Thread Mensanator
On Jun 8, 3:19�am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Mensanator" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | On Jun 7, 6:43?pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > | > zip(range(9,20), iterable) > | > | Oh, dear. You didn't actually try this, did you

Trying out safethread patch

2008-06-08 Thread skip
I'd like to take the python-safethread code out for a spin, but I'm not sure where to start. I downloaded the latest diff: http://python-safethread.googlecode.com/files/safethread-bzr-36020.diff checked out Python 3.0 from the bzr mirror, then ran patch in the typical way. That doesn't app

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

2008-06-08 Thread Luis Zarrabeitia
I don't know about Erlang (though I'd think it's behaviour sould be similar to prolog), but at least in Prolog, yes, _ and _ are different variables. The whole idea of "_" is that it is a placeholder that can bind to anything, but will be immediately discarded. It's just syntactic sugar so you don

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

2008-06-08 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Mark Wooding <[EMAIL PROTECTED]> wrote: > By enforcing your `data hiding', you're effectively telling me that I'm > too stupid to make rational decisions of this sort. And that's actually > extremely insulting. I think that's taking it a bit far. Python doesn't

Re: File-writing not working in Windows?

2008-06-08 Thread tdahsu
On Jun 8, 4:11 am, Lie <[EMAIL PROTECTED]> wrote: > On Jun 6, 10:18 pm, [EMAIL PROTECTED] wrote: > > > > > > > All, > > > I have the following code: > >            for fileTarget in dircache.listdir("directory"): > >                 (dirName, fileName) = os.path.split(fileTarget) > >              

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

2008-06-08 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Mark Wooding <[EMAIL PROTECTED]> wrote: > * Prolog and Erlang distinguish atoms from variables by the case of > the first letter; also `_' is magical and is equivalent to a new > variable name every time you use it. Can you explain that in more detail?

Re: Most effective coding.. IDE question.

2008-06-08 Thread Ken Starks
dave wrote: Hello everyone, I'm a beginning self-taught python student. Currently, I work out my code within IDLE then when I have a version that I like, or that's working, I move it over to a new window and save it. I've been playing w/ Komodo IDE lately, and while it's nice, what I don't

Re: Newbie question, list comprehension

2008-06-08 Thread Mark Wooding
Johannes Bauer <[EMAIL PROTECTED]> wrote: > import time > localtime = time.localtime(1234567890) > fmttime = "%04d-%02d-%02d %02d:%02d:%02d" % (localtime[0], localtime[1], > localtime[2], localtime[3], localtime[4], localtime[5]) > print fmttime > > fmttime = "%04d-%02d-%02d %02d:%02d:%02d" % ([l

china supply nike shoes oz,nike air max 95,dunk...

2008-06-08 Thread [EMAIL PROTECTED]
"China (www.getvogue.com) supply Nike_Air_Max_87,Nike_Air_Max_95,Nike_Air_Max_360,Nike_Air_Max_Ltd,Nike_Air_Max_TN,Nike_Air_Max_Rift,Nike_Shoes_R3,Nike_Shoes_R4,Nike_Shoes_R5,Nike_Shoes_R6,Nike_Shoes_NZ,Nike_Shoes_OZ,Nike_Shoes_TL,Nike_Shoes_Monster,Nike_Sho¬es_Energia,Nike_Shoes_Turob,Air_Force_1s

Re: Code correctness, and testing strategies

2008-06-08 Thread David
Thanks for your informative reply. On Sun, Jun 8, 2008 at 12:28 PM, Ben Finney <[EMAIL PROTECTED]> wrote: > David <[EMAIL PROTECTED]> writes: > [...] > >> My problem is that I haven't run the app once yet during development >> :-/ > > That might be an artifact of doing bottom-up implementation >

ANN: Pyrex 0.9.8.3

2008-06-08 Thread greg
Pyrex 0.9.8.3 is now available: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/ Compiling multiple .pyx files in one go works properly now, and can be substantially faster if you have a lot of modules that cimport from each other. I had to rearrange various things to make this work,

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

2008-06-08 Thread Mark Wooding
Fuzzyman <[EMAIL PROTECTED]> wrote: > So, you are stating that no API programmer using Python *ever* has a > valid or genuine reason for wanting (even if he can't have it) genuine > 'hiding' of internal state or members from consumers of his (or > her...) API? I don't want to speak for whoever yo

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

2008-06-08 Thread Mark Wooding
Russ P. <[EMAIL PROTECTED]> wrote: > The idea of being able to discern properties of an object by its name > alone is something that is not normally done in programming in > general. Really? You obviously haven't noticed Prolog, Smalltalk, Haskell, ML, or Erlang then. And that's just the ones

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

2008-06-08 Thread Mark Wooding
Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > How about #define class struct Won't work. Consider `template ...'. -- [mdw] -- http://mail.python.org/mailman/listinfo/python-list

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

2008-06-08 Thread Mark Wooding
Paul Rubin wrote: > This is bogus about 95% of the time though. For the cases where it is > really desired, I think it's best to require the target class to be > enable it specifically somehow, maybe by inheriting from a special > superclass. That could let the compiler statically resolve membe

Re: What's a call-tip to do?

2008-06-08 Thread Tal Einat
"Terry Reedy" wrote: > "Raymond Hettinger" wrote > > Tal Einat wrote: > > > I just ran into this. In IDLE (Python 2.5), the call-tip for > > itertools.count is: > > "x.__init__(...) initializes x; see x.__class__.__doc__ for signature" > > | My IDLE (1.2.2 running on Python 2.5.2) has the correct c

Re: UnicodeEncodeError while reading xml file (newbie question)

2008-06-08 Thread nikosk
You won't believe how helpful your reply was. I was looking for a problem that did not exist. You wrote : > (3) why you think you need to have "data.decode(.)" at all and after that : > (7) are you expecting non-ASCII characters after H_C= ? what > characters? when you open your xml file in a b

time.clock() or Windows bug?

2008-06-08 Thread Theo v. Werkhoven
hi, In this code I read out an instrument during a user determined period, and save the relative time of the sample (since the start of the test) and the readback value in a csv file. #v+ from datetime import * from time import * from visa import * from random import * [..] for Reading in range(

Re: Code correctness, and testing strategies

2008-06-08 Thread Ben Finney
David <[EMAIL PROTECTED]> writes: > I'm asking about this, because as suggested by various posters, I > have written my latest (small) app by following a Behaviour-Driven > Development style. Congratulations on taking this step. > That went well, and the code ended up much more modular than if I

Re: How to get System.Timers.Timer

2008-06-08 Thread Christian Heimes
John Machin wrote: > One grabs one's googler and goes a-huntin' ... > ==>> http://msdn.microsoft.com/en-us/library/system.timers.aspx > Looks like part of .NET so one might expect that one already have it. > However one would need to use IronPython to access it ... Or the PythonDotNET extension fo

Problem pickling exceptions in Python 2.5/2.6

2008-06-08 Thread Irmen de Jong
I'm having troubles pickling classes that extend Exception. Given the following source: class Foo(object): def __init__(self, m): self.m=m class Bar(Exception): def __init__(self, m): self.m=m import pickle s=pickle.dumps(Foo("test")) pickle.loads(s) # normal object w

Re: Interesting Math Problem

2008-06-08 Thread Lie
On Jun 6, 2:25 am, "Rüdiger Werner" <[EMAIL PROTECTED]> wrote: > "BEES INC" <[EMAIL PROTECTED]> schrieb im Newsbeitragnews:[EMAIL PROTECTED] > ... > > Problem: Star Ratings > > People can rate cheeseburgers on my website with a star rating of 0-5 > stars (whole stars only), 5 being mighty tasty a

Re: Different execution time in python code between embedded or standalone

2008-06-08 Thread Pau Freixes
HI list, I found the problem guys, when I embedded python code didn't call to PyEval_InitThreads(); This function initialize GIL and other data structures for do a python code thread safe. I believe the python traditional ( python name_script.py ) run always a thread safe interpreter. Therefore,

Re: SQlite none english char

2008-06-08 Thread Gandalf
On Jun 8, 11:00 am, Gerhard Häring <[EMAIL PROTECTED]> wrote: > Gandalf wrote: > > I works with python 2.5 on windows,  And I use sqlite3 > > > Now, I have problem searching string in Hebrew in my database > > > I have table called "test" with field num and test > > firs row i insert  "1" and "עברי

Re: Python is slow

2008-06-08 Thread Mark Tarver
On 22 May, 17:14, cm_gui <[EMAIL PROTECTED]> wrote: > Python is slow.    Almost all of the web applications written in > Python are slow.   Zope/Plone is slow, sloow, so very slooow.  Even > Google Apps is not faster.   Neither is Youtube. > Facebook and Wikipedia (Mediawiki), written in PHP, are s

Re: Can this be done with list comprehension?

2008-06-08 Thread Duncan Booth
Lie <[EMAIL PROTECTED]> wrote: > On Jun 8, 7:27 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: >> "Karlo Lozovina" <[EMAIL PROTECTED]> wrote in message >> >> news:[EMAIL PROTECTED] >> | I figured that out few minutes ago, such a newbie mistake :). The >> | fix I came up with is: >> | >> |  result =

Re: Do this as a list comprehension?

2008-06-08 Thread Lie
On Jun 8, 8:56 am, Mensanator <[EMAIL PROTECTED]> wrote: > On Jun 7, 8:22�pm, John Salerno <[EMAIL PROTECTED]> wrote: > > > Mensanator wrote: > > > What I DID say was that how the builtins actually > > > work should be understood and it APPEARED that the > > > OP didn't understand that. Maybe he un

Re: SQlite none english char

2008-06-08 Thread Gerhard Häring
Gandalf wrote: > I works with python 2.5 on windows, And I use sqlite3 > > Now, I have problem searching string in Hebrew in my database > > I have table called "test" with field num and test > firs row i insert "1" and "עברית" (that is "Hebrew" in Hebrew) > second row i insert "2" and "Englis

Re: Can this be done with list comprehension?

2008-06-08 Thread Lie
On Jun 8, 7:27 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Karlo Lozovina" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | I figured that out few minutes ago, such a newbie mistake :). The fix I > | came up with is: > | > |  result = ['something'] + [someMethod(i) for i in s

Re: Code correctness, and testing strategies

2008-06-08 Thread David
Hi list. Do test-driven development or behaviour-driven development advocate how to do higher-level testing than unit testing? >From reading up on the subject, I see that there are formally these types of testing: unit integration system acceptance I'm asking about this, because as suggested by

Re: simple question on list manipulation from a newbie

2008-06-08 Thread John Machin
On Jun 8, 4:42 pm, Sengly <[EMAIL PROTECTED]> wrote: [snip] > Thank you all for your help. I found a solution as the following: The following is a solution to what? > > alist = [ > {'noun': 'dog', 'domestic_dog', 'Canis_familiaris'}, That is not yet valid Python. You will get a syntax error

Re: Do this as a list comprehension?

2008-06-08 Thread Lie
On Jun 8, 12:24 am, Mensanator <[EMAIL PROTECTED]> wrote: > On Jun 7, 5:21�am, Paul Miller <[EMAIL PROTECTED]> wrote: > > > On Fri, 06 Jun 2008 18:01:45 -0700, Mensanator wrote: > > > What happens if your iterables aren't the same length? > > > I chose not to consider that case, > > That's a bad ha

Re: Do this as a list comprehension?

2008-06-08 Thread Terry Reedy
"Mensanator" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Jun 7, 6:43?pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: | > zip(range(9,20), iterable) | | Oh, dear. You didn't actually try this, did you? Works fine in Py3, which is what I use now. -- http://mail.python.

Re: File-writing not working in Windows?

2008-06-08 Thread Lie
On Jun 6, 10:18 pm, [EMAIL PROTECTED] wrote: > All, > > I have the following code: >            for fileTarget in dircache.listdir("directory"): >                 (dirName, fileName) = os.path.split(fileTarget) >                 f = open(fileTarget).readlines() >                 copying = False >  

online money

2008-06-08 Thread punitha . d24
online money online business money is very important http://worldlangs.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list