Re: win32api install problem

2009-07-22 Thread Tim Roberts
t; >Can anyone offer a suggestion? It is very unusual that those three directories should have different creation dates. Normally, all three would have the same date and time, from whenever you ran the installer. I would suggest that you go into Add and Remove Programs, uninstall pywin32, and run the

Re: Documentation Problems

2009-07-22 Thread Tim Golden
Mark du Preez wrote: Hi Can anyone tell me where to go to suggest changes to the Python documentation? Drop an entry in the tracker: http://bugs.python.org Patches are always welcome, or at least suggested wording rather than vague "I don't think it should say that" -- although that's bett

Re: Help understanding the decisions *behind* python?

2009-07-23 Thread Tim Rowe
builds *very* heavily on the concept of dictionaries it's not obscure at all! -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlite3 performance problems only in python

2009-07-23 Thread Tim Chase
until now I used only small / simple databases in Python with sqlite3. Now I've a large and rather complex database. The most simple query (with just a result of 100 rows), takes about 70 seconds. And all that time is consumed in "cursor.fetchall" Using the same database in Delphi, using the sam

Re: integer square roots

2009-07-23 Thread Tim Daneliuk
timro21 wrote: > Thanks to all! > > Tim While we're at it, would you mind saying more about what exactly you're doing - Inquiring Math Dorks (tm) want to know ... -- -------- Tim Daneliuk tun...@tun

Re: len() should always return something

2009-07-24 Thread Tim Chase
Marcus Wanner wrote: First one to correctly decompress the value 0 into an ASCII character wins the title of the world's most capable hacker :p Bah...uncompressing the value 0 into *an* ASCII character is easy. Uncompressing it into the *original* ASCII character from which it was compressed

Re: Regexp problem

2009-07-30 Thread Tim Chase
I have a problem and i'm not very good at regular expressions. I have a text like "lalala lalala tiruri beldar-is-listening tiruri lalala" I need a regexp to get the 'beldar' part, the format is 'something-is-listening', i need to get the something part, use it in my code, and then replace the who

Re: Help with Regex for domain names

2009-07-30 Thread Tim Daneliuk
pages.tesco.net/J.deBoynePollard/FGA/web-fully-qualified-domain-name.html -- ---- Tim Daneliuk [email protected] PGP Key: http://www.tundraware.com/PGP/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-07-30 Thread Tim Rowe
or me. That and the fact that I couldn't stop laughing for long enough to learn any more when I read in the Pragmatic Programmer's Guide that "Ruby, unlike less flexible languages, lets you alter the value of a constant." Yep, as they say "Bug" = "Undocumented feature"! -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-07-30 Thread Tim Rowe
2009/7/30 superpollo : > Tim Rowe wrote: >> Any language that gets any sort of real use has to have. For instance, >> I love Ada's numeric types (you can specify either the minimum number >> of significant figures or the maximum delta for a real type, and it >> wil

Re: Confessions of a Python fanboy

2009-07-31 Thread Tim Rowe
2009/7/31 Steven D'Aprano : > On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: > >> That and the fact that I couldn't stop laughing for long enough to learn >> any more when I read in the Pragmatic Programmer's Guide that "Ruby, >> unlike less flexi

Re: Python docs disappointing

2009-07-31 Thread Tim Chase
Martin P. Hellwig wrote: kj wrote: [excerpt of previously snipped content restored] I'm sure that I can find a full description of this parameter if I fire up Google, and search online. In fact, more likely than not, I'll find far more documentation than I want. But my point is that a program

Re: Python docs disappointing

2009-08-01 Thread Tim Golden
jkn wrote: The ActiveState distribution also includes the doc set as a CHM file (the canonical version didn't used to; one reason why I've used ActiveState in the past). It has done for quite some while now: Python 2.3 was the first and that was released, what, six years ago. Still, you're rig

Re: Is python buffer overflow proof?

2009-08-04 Thread Tim Chase
Marcus Wanner wrote: On 8/3/2009 3:45 AM, Diez B. Roggisch wrote: But you can cast the resulting pointer to an array of larger size, and there you are. Ah, that makes sense. I had forgotten about ctypes.cast(). You *can* shoot yourself in the foot with Python, you just have to aim much more

oNVDL validation docbook 5

2009-08-05 Thread Tim Arnold
r. Any suggestions or pointers welcome. thanks, --Tim Arnold -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python to automate builds

2009-08-05 Thread Tim Arnold
specify environment dictionaries in the subprocess.Popen module. You can set a different dictionary for each call you make to the system. Not sure if that helps, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: question: why isn't a byte of a hash more uniform? how could I improve my code to cure that?

2009-08-07 Thread Tim Chase
After I have written a short Python script that hashes my textfile line by line and collects the numbers next to the original, I checked what I got. Instead of getting around 25% in each treatment, the range is 17.8%-31.3%. That sounds suspiciously like 25% with a +/- 7% fluctuation one might e

Re: Changing Remote Registry

2009-08-07 Thread Tim Golden
Kevin Holleran wrote: Long story short, I am using _winreg to do this. hKey = _winreg.OpenKey (keyPath, path, 0, _winreg.KEY_SET_VALUE) value,type = _winreg.QueryValueEx(hKey, item) if (value == wrongValue): _winreg.SetValue(hKey,'',_winreg.REG_SZ,correctValue) When I do this I receive

Re: String algo

2009-08-09 Thread Tim Chase
nipun batra wrote: I will be receiving data serially from another pc,.i can use any sort of marker between two packets,i will be the person sending data as well after reading it from some devices.But packet length is not constant. each packet has this format: 201.535a56.65b4.56c89.565d another pa

Re: Using Python to automate builds

2009-08-09 Thread Tim Roberts
imr cd %LAST% build %BLD% endlocal setlocal set LAST=%CD% call %DDK%\bin\setenv %DDK% chk WLH x64 no_oacr @echo on set USERNAME=timr cd %LAST% build %BLD% endlocal -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pywin32 @ windows 7

2009-08-09 Thread Tim Roberts
dows 7 64-bit for many months. No problems. I have not tried the 64-bit Python and PyWin32 builds yet. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows 7 : any problems installing or running Python ?

2009-08-09 Thread Tim Roberts
er developers have expressed the same opinion. Microsoft might actually have a winner here. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

coding for multiple versions of python

2009-08-13 Thread Tim Arnold
never I commit. Does that sound right? Is there a better way I'm not thinking of? thanks, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: coding for multiple versions of python

2009-08-14 Thread Tim Arnold
"Tim Arnold" wrote in message news:[email protected]... > Hi, > I've got a python based system that has to run on hp unix and red hat > linux. The Python version on the HP is 2.4 and the version on the Linux > box is 2.6. There's nothing I can do ab

Re: Pygresql, and query meta informations

2009-08-15 Thread Tim Roberts
pg_attribute. pg_class contains information about your tables; when you fetch the class number for your table, you can look up the columns in pg_attribute. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: flatten a list of list

2009-08-17 Thread Tim Cook
On Aug 16, 6:47 am, Terry wrote: > Hi, > > Is there a simple way (the pythonic way) to flatten a list of list? > rather than my current solution: > > new_list=[] > for l in list_of_list: >     new_list.extend(l) > > or, > > new_list=reduce(lambda x,y:x.extend(y), list_of_list) > > br, Terry Well,

Re: Barcodes

2009-08-17 Thread Tim Chase
My company needs a small inventory management app. Does python have any libraries to help with reading and writing bar codes? I've written bar code apps and python really doesn't enter into that part of things. Printers generally have bar code printing capabilities so you just send the right es

Re: simplest way to visit 3 subdirectories with a command?

2009-08-18 Thread Tim Chase
could you inform how to compose a py-file (for soft installation), that will visit 3 subdirectories (eg subdir1, subdir2, subdir3) and invoke a command "python setup.py install" in each subdirectory? I know there should be a simple solution available in Python If you're executing "python setup.p

Re: Excel edit using python

2009-08-19 Thread Tim Wintle
rg/pipermail/python-list/2009-June/716845.html Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary from a list

2009-08-20 Thread Tim Chase
Peter Otten wrote: it = iter([1,2,3,4,5,6]) dict(izip(it, it)) {1: 2, 3: 4, 5: 6} Zip(it). Zip(it) good. it's-3:00am-and-i-seriously-need-to-sleep'ly yers... -tkc -- http://mail.python.org/mailman/listinfo/python-list

2.6 windows install

2009-08-20 Thread Tim Arnold
ed are set wide-open for everyone. Any ideas on what I'm missing here? thanks, --Tim Arnold -- http://mail.python.org/mailman/listinfo/python-list

Invitation to connect on LinkedIn

2009-08-21 Thread Tim Heath
LinkedIn Tim Heath requested to add you as a connection on LinkedIn: -- Jaime, I'd like to add you to my professional network on LinkedIn. - Tim View invitation from Tim Heath http://www.linkedin.com/e/I2LlXdLlWUhFABKmxVOlgGLlWUhFAf

Re: debugger

2009-08-22 Thread Tim Chase
Stef Mientki wrote: Albert Hopkins wrote: On Sat, 2009-08-22 at 01:17 -0700, flagmino wrote: [...] I am trying to debug: I press shift-F9 and F7. I end up in the interpreter where I enter s2 (1, 2). >From that point if I press F7, the program restart all over. If I press Enter, the program

Re: sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ?

2009-08-22 Thread Tim Chase
bolega wrote: sed/awk/perl: Better to post in the "sed" or "perl" mailing lists rather than a Python list. I saw an awk solution flew by. How to replace all spaces each with an underscore that occur before a specific string ? I really prefer a sed one liner. Here's a one-liner sed solutio

Re: Temat:,Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-24 Thread Tim Golden
Dave Angel wrote: You still haven't gotten rid of those illegal colons in the filename. They're not legal in Windows, as has been pointed out a couple of times in this thread. Ummm.. Colons are of course legal in Windows filenames as designating the Alternate Data Streams: with open ("c:/t

Re: How does the file.seek() work ?

2009-08-24 Thread Tim Chase
I want the file pointer set to 100 and overwrite everything from there [snip] def application(environ, response): query=os.path.join(os.path.dirname(__file__),'teemp') range=environ.get('HTTP_RANGE','bytes=0-').replace ('bytes=','').split(',') offset=[] for r in range: of

Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-24 Thread Tim Roberts
me. It's just that simple. >Maybe it's good idea to use raw string for specifing those paths? Doesn't matter. Get rid of the colons, and your file name will work. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: why python got less developers ?

2009-08-27 Thread Tim Roberts
Deep_Feelings wrote: > >python got relatively fewer numbers of developers than other high >level languages like .NET , java .. etc why ? How do you know, and why does it matter? By the way, .NET is not a language. I assume you meant C#. -- Tim Roberts, [email protected] Providenza &

Re: What python can NOT do?

2009-08-28 Thread Tim Chase
qwe rty wrote: i know that an interpreted language like python can't be used to make an operating system or system drivers. As long as you are willing to write the OS hooks in C, you can write the userspace device drivers in Python: https://www.linuxquestions.org/questions/programming-9/how-

Re: What python can NOT do?

2009-08-28 Thread Tim Chase
what else can NOT be done in python? what are the limitations of the language? I understand there's a little trouble getting Python to prove that P=NP You'll also find that it only comes close to solving the unrestricted three-body problem and the Traveling Salesman problem is still limited

Re: What python can NOT do?

2009-08-28 Thread Tim Chase
qwe rty wrote: On Aug 29, 3:14 am, Tim Chase wrote: what else can NOT be done in python? what are the limitations of the language? I understand there's a little trouble getting Python to prove that P=NP You'll also find that it only comes close to solving the unrestricted three-bo

Re: Sqlite format string

2009-08-29 Thread Tim Chase
I have this statement cursor.execute("SELECT * from session_attribute WHERE sid=%s", ( user )) and I'm receiving this error : TypeError: not all arguments converted during string formatting Two possibilities occur to me: 1) the 2nd parameter to execute() usually needs to be a tuple (or maybe

Re: Sqlite format string

2009-08-29 Thread Tim Chase
[email protected] wrote: 29.08.2009 15:40 пользователь "Sergio Charpinel Jr." написал: Thanks. Do you know if both of them works for mysql too? 2009/8/29 [email protected]> 29.08.2009 15:27 пользователь "Sergio Charpinel Jr." [email protected]> написал: Actually, this wo

Re: a popen question. Please help

2009-08-30 Thread Tim Chase
texts = os.popen('top').readlines() print texts It calls the command line "top" and will print out some texts. But first I have to press the keyboard "q" to quit the subprocess "top", then the texts will be printed, otherwise it just stands by with blank. Question is. Do you know how to give "q

Re: a popen question. Please help

2009-08-30 Thread Tim Chase
os.popen('top -n1').readlines() Hm, interesting. On Mac OS X's (and BSD's?) top, -n instead specifies the number of processes to list at a time (i.e. list only the top N processes), which is entirely different. [reaching over to my Mac] Looks like "top" there supports a -l parameter which do

Re: why python got less developers ?

2009-08-30 Thread Tim Roberts
Esam Qanadeely wrote: >On Aug 28, 8:27 am, Tim Roberts wrote: >> Deep_Feelings wrote: >> >> >python got relatively fewer numbers of developers than other high >> >level languages like .NET , java .. etc  why ? >> >> How do you know, and why do

Re: Efficient way to sum a product of numbers...

2009-08-31 Thread Tim Chase
After simplifying my problem, I can say that I want to get the sum of the product of two culumns: Say m= [[ 'a', 1], [ 'b', 2],[ 'a', 3]] assuming you meant ['c', 3] here...^ r={'a':4, 'b':5, 'c':6} What I need is the calculation 1*4 + 2*5 + 3*4 = 4 + 10 + 12 =

Re: Efficient way to sum a product of numbers...

2009-08-31 Thread Tim Chase
vsoler wrote: On Aug 31, 6:30 pm, Tim Chase wrote: After simplifying my problem, I can say that I want to get the sum of the product of two culumns: Say m= [[ 'a', 1], [ 'b', 2],[ 'a', 3]] assuming you meant ['c', 3] here...^> r

Re: find free hard disk space remote windows host

2009-08-31 Thread Tim Golden
Daniel wrote: Hello, I'm trying to determine the amount of free hard disk space on a remote windows host. Seems like this should be simple, but it's giving me grief. Here's what I've tried: mystat = os.stat('//remotehost/share/') mystat (16895, 0L, 0, 0, 0, 0, 0L, 1251731920, 1251731289, 12

Re: Python word to text

2009-09-01 Thread Tim Golden
BJörn Lindqvist wrote: 2009/9/1 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

using queue

2009-09-01 Thread Tim Arnold
seudocode for what I'm thinking: q = Queue(maxsize=80) for chap in [x.config['name'] for x in self.document.chapter_objects]: c = self.compiler(self.document.config['name'], chap) t = threading.Thread(target=c.compile) t.start() q.put(t) q.join() is that the r

Re: Is behavior of += intentional for int?

2009-09-02 Thread Tim Roberts
>This would be pretty disturbing behaviour, and anything but intuitive. Yes, indeed, and it's quite possible to write code like this in Fortran that produces exactly this result -- an integer constant gets modified. This used to get big yucks when we gathered around the keypunch, befor

Re: Entry Level Python Jobs

2009-09-02 Thread Tim Wintle
- in order of importance: * Experience (e.g. open source / hobby projects / work) - several years worth. * Problem solving ability * A good comprehension of C, machine code, or something where you have to care about pointers/references. * Basic maths skills. Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: using queue

2009-09-02 Thread Tim Arnold
"MRAB" wrote in message news:[email protected]... > Tim Arnold wrote: >> Hi, I've been using the threading module with each thread as a key in a >> dictionary. I've been reading about Queues though and it looks like >&

Re: string find mystery

2009-09-03 Thread Tim Chase
I have come across this very strange behaviour. Check this code: if file_str.find('Geometry'): While the "anser" is to compare the results of .find() with -1, but the more Pythonic answer is just to use "in": if "Geometry" in file_str: which reads a lot more cleanly, IMHO. -tkc

Re: match braces?

2009-09-03 Thread Tim Chase
In C/C++ you use the braces where as in Python you use the indentation levels. Most editors offer a Ctrl+[ to match the braces so that you can easily identify the scopes (more correctly "statements blocks"). I am finding it difficult to see blocks and/or jump from end to start with some IDE hotke

Re: win32pipe

2009-09-03 Thread Tim Golden
Hans Müller wrote: Hello, I'd like to play a little with named pipes on windows. For this purpose google told me there is a win32pipe module. My python2.6 on windows doesn't know it - so where can I get ? Does it belong to the std. python for windows or is it a separate package ? It's part of

Re: using queue

2009-09-03 Thread Tim Arnold
"Jan Kaliszewski" wrote in message news:[email protected]... > 06:49:13 Scott David Daniels wrote: > >> Tim Arnold wrote: > >>> (1) what's wrong with having each chapter in a separate thread? Too >>> much going o

Re: File Handling Problem

2009-09-04 Thread Tim Golden
Rami Chowdhury wrote: f = open("myfile.txt", "r") list_one = f.read().splitlines() f.close() Or use f.readlines(), which would do the same thing IIRC? No: readlines () retains the "\n"s; splitlines () loses them TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Q on explicitly calling file.close

2009-09-05 Thread Tim Chase
CPython uses reference counting, so an object is garbage collected as soon as there are no references to it, but that's just an implementation detail. Other implementations, such as Jython and IronPython, don't use reference counting, so you don't know when an object will be garbage collected, wh

Re: Support for Windows 7 ?

2009-09-05 Thread Tim Roberts
deeply nested paths on different drives: D: cd "\Ridiculous\Long\Path\Names\For Annoyance" C: cd "\Another\Ridiculous\Long\Path\Name" copy C:one.txt D:two.txt -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I format unicode strings?

2009-09-09 Thread Tim Northover
the {} to tell it which argument to use. In 3.1 all strings are unicode. Apparently when 2.7 is released it will backport the empty {} feature from 3.1. Until then return u'{0}'.format(self.name) is what you should probably use. Tim. -- http://mail.python.org/mailman/listinfo/python-list

Re: logging sound / speech handler?

2009-09-09 Thread Tim Chase
For an application in an industrial environment where the workers are not always sitting in front of the monitor, but are within earshot of the PC I would need an sound / speech handler for the standard logging system. It should beep or better say the logging message. (with standard filtering etc.

Re: HTTP POST File without cURL

2009-09-11 Thread Tim Roberts
John Giotta wrote: > >Is there a verbose feature for urllib2.urlopen? You have the full source code for the module right in front of you. Bringing up urllib2.py in an editor is quicker than waiting for a newsgroup reply. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc

Re: Simple Text Processing

2009-09-11 Thread Tim Roberts
egular expression matches. When you're good with Python, you start to think of every task in terms of lists and tuples. Stick with it, and you'll start thinking Pythonically in no time. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to return value from button clicked by python

2009-09-11 Thread Tim Roberts
ion you need to take when the button is clicked, then you DO that function in the button handler. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Finite state machine in python

2009-09-12 Thread Tim Chase
I have see some discussion on the implementation of finite state machine in python. Can somebody point to me the best way in implenting an FSM in python? To offer a "best way" requires knowing more about what you're trying to accomplish. Are you looking for just some fixed states? are you lo

Re: Is there a similar mailing list about django?

2009-09-13 Thread Tim Chase
Joel Goldstick wrote: I'm learning python and django more or less concurrently. I've googled to find a similar list like this for django. Help? There's a Django Users mailing list over on Google Groups. http://groups.google.com/group/django-users You want Django *Users* for folks that use

Re: Is there a similar mailing list about django?

2009-09-13 Thread Tim Chase
Thanks.. I saw the google group, but I was hoping for a list that I can read in my thunderbird client. Thanks all for the good pointers You can subscribe to the google group via email (which is what I did previously with TB), or you can subscribe to the mirrored copy of it over at gmane.comp

Re: Simple Text Processing

2009-09-13 Thread Tim Roberts
Steven D'Aprano wrote: >On Fri, 11 Sep 2009 21:52:36 -0700, Tim Roberts wrote: > >> Basically, when you're good with Perl, you start to think of every task >> in terms of regular expression matches. When you're good with Python, >> you start to think of

Re: equation of a graph

2009-09-14 Thread Tim Chase
but i want to find *"best-fit curve" * What type of curve? Polynomial (of which your rejected linear is a low-order variant)? Exponential or logarithmic? Bell curve? S-curve? Circle? Axis-aligned ellipse? non-axis-aligned ellipse? There are lots of curvy possibilities here... -tkc (Bl

Re: How to improve this code?

2009-09-14 Thread Tim Chase
def elementsPresent(aList, match): match = set(match) for item in aList: if item in match: return True return False This could be rewritten in Python2.5+ as def elementsPresent(aList, match): match = set(match) return any(elem in match for elem in

Re: How to improve this code?

2009-09-15 Thread Tim Golden
Sol Toure wrote: def are_elements_present(sourceList, searchList):for e in searchList: if e not in sourceList: return False return True Using set: def are_elements_present(sourceList, searchList): return len(set(sourceList).intersection(set(searchList

Re: How to improve this code?

2009-09-15 Thread Tim Golden
Tim Golden wrote: Unless I'm missing something, (and I didn't bother to read the original code so I may be) that's a subset test: set (searchList) <= set (searchList) (cough) or, rather: set (searchList) <= set (sourceList) TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: unpacking vars from list of tuples

2009-09-15 Thread Tim Chase
If I have a list of tuples: k=[("a", "bob", "c"), ("p", "joe", "d"), ("x", "mary", "z")] and I want to pull the middle element out of each tuple to make a new list: myList = ["bob", "joe", "mary"] is there some compact way to do that? I can imagine the obvious one of myList = [] for a in

Re: socket.MSG_WAITALL flag broken on Windows XP in Python 2.5.4?

2009-09-15 Thread Tim Roberts
ies (like Pyro) that use it if >it's available in the socket module. > >Does anyone know more about this? MSG_WAITALL is supported, starting with Windows Server 2003. It's a tough situation. Ideally, you'd want socket to remove that symbol on the systems where it'

Re: SQLite or files?

2009-09-17 Thread Tim Chase
info was stored in the simple RTF files. However now I'd like to rewrite this program in Python (using PyQt) as I want to make it cross-platform and add/remove some features. Now I'm thinking about where to store my information. Would it be better to use files as I used to do or use the database,

Re: An assessment of the Unicode standard

2009-09-17 Thread Tim Rowe
er with tentacles and fangs, that my language doesn't have a word for and that I have never seen. On your theory, how come I am thinking about it? -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite or files?

2009-09-18 Thread Tim Chase
You can also make a SQLite database be in-memory, giving you the performance benefits of skipping the disk. Yes, I love the in-memory database -- especially for my automated testing in Django. However, the OP said that memory footprint was a concern (granted, I don't know how much data they

Re: Not this one the other one, from a dictionary

2009-09-18 Thread Tim Chase
Learning my way around list comprehension a bit. I wonder if someone has a better way to solve this issue. I have a two element dictionary, and I know one of the keys but not the other, and I want to look up the other one. Several ways occur to me. Of the various solutions I played wit

Re: class initialization problem

2009-09-19 Thread Tim Roberts
t. As it is, you have a somewhat confusing situation. If I do this: x = Face( points ) Now I can refer to x.backface, but there is no x.backface.backface. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to change string or number passed as argument?

2009-09-19 Thread Tim Chase
I know that strings or numbers are immutable when they passed as arguments to functions. But there are cases that I may want to change them in a function and propagate the effects outside the function. I could wrap them in a class, which I feel a little bit tedious. I am wondering what is the comm

Re: An assessment of the Unicode standard

2009-09-20 Thread Tim Rowe
I was only 3 when it was released. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question, how to double a variable

2009-09-20 Thread Tim Chase
daggerdvm wrote: Write the definition of a function twice , that receives an int parameter and returns an int that is twice the value of the parameter. how can i do this Read over your textbook and the notes you took in class -- I'm sure therein you'll find how to define functions, how to

Re: easy question, how to double a variable

2009-09-21 Thread Tim Chase
Steven D'Aprano wrote: Write the definition of a function twice , that receives an int parameter and returns an int that is twice the value of the parameter. how can i do this Yes, that certainly is an easy question. Here's my solution: class MultiplierFactory(object): [snip a marvel of

Re: easy question, how to double a variable

2009-09-21 Thread Tim Chase
But you actually want to return twice the value. I don't see how to do that. Ah, I think I see...returning more than once is done with the "yield" keyword: def f(param): yield param yield param That returns twice the integer parameter... :-D However, the OP was instructed to "Wri

Re: easy question, how to double a variable

2009-09-21 Thread Tim Roberts
we can help you make it work. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question, how to double a variable

2009-09-22 Thread Tim Chase
daggerdvm wrote: what are you retarded? this is not a test you moron, i can ask all the questions i want about it. You seem to have forgotten to CC the list. Let me help show the world your "mad skillz" -- at replying, at programming, at orthography, at interpersonal communication... Sur

Re: Copy directory tree without copying files

2009-09-23 Thread Tim Golden
Jeremy Conlin wrote: I am trying to copy a folder hierarchy from one location to another. I can use the shutil.copytree function to copy the folder tree, but I don't want the files copied, just the folders. What is a good way to approach this? Thanks, Jeremy Use os.walk and create the directo

Re: Copy directory tree without copying files

2009-09-23 Thread Tim Golden
Jeremy Conlin wrote: On Sep 23, 9:15 am, Tim Golden wrote: Jeremy Conlin wrote: I am trying to copy a folder hierarchy from one location to another. I can use the shutil.copytree function to copy the folder tree, but I don't want the files copied, just the folders. What is a good w

Re: Finding application data after install - a solution?

2009-09-24 Thread Tim Golden
Wolodja Wentland wrote: I think many Windows users would say WTF!? when seeing those directories - and send cordial greetings to you, your parents and your whole family :) That is probably true, but Windows has a 'etc' directory (c:\windows\system32\drivers\etc) which AFAIK contains the hosts f

Re: Finding application data after install - a solution?

2009-09-24 Thread Tim Golden
Wolodja Wentland wrote: On Thu, Sep 24, 2009 at 12:51 +0100, Tim Golden wrote: Wolodja Wentland wrote: Is CSIDL_COMMON_APPDATA and environment variable set on all Windows flavours? Just to clarify, now that I read your post more carefully, there *is* an environment variable APPDATA which is

Re: Date using input

2009-09-24 Thread Tim Chase
Surely getting it tottally mixed up from datetime import date def ObtainDate(params): date = raw_input("Type Date dd/mm/year: %2.0r%2.0r/%2.0r%2.0r/%4.0r %4.0r%4.0r%4.0r") print date.datetime(year-month-day) By setting "date = raw_input(...)", you mask the datetime.date object preventing yo

Re: Poll: Do you use csv.Sniffer?

2009-09-25 Thread Tim Chase
Why do you need the sniffer? If your client can't do "save as" the same way twice, just read the spreadsheets directly! If I only had one contact and one client, it would be this easy...If you can get multiple points of contact at multiple client sites to reliably & competently agree on a form

Re: split string into multi-character "letters"

2010-08-25 Thread Tim Chase
On 08/25/10 14:46, Jed wrote: Hi, I'm seeking help with a fairly simple string processing task. I've simplified what I'm actually doing into a hypothetical equivalent. Suppose I want to take a word in Spanish, and divide it into individual letters. The problem is that there are a few 2-character

Re: Tag parsing in python

2010-08-28 Thread Tim Chase
On 08/28/10 11:14, agnibhu wrote: For example say I've key words like abc: bcd: cde: like that... So the user may use like abc: How are you bcd: I'm fine cde: ok So I've to extract the "How are you" and "I'm fine" and "ok"..and assign them to abc:, bcd: and cde: respectively.. For this, you ca

Re: shlex, unicode, and subprocess.Popen on Windows

2010-08-30 Thread Tim Golden
On 30/08/2010 3:24 PM, [email protected] wrote: My understanding is that the only time one needs to use shell=True is when they are 'executing' a non-executable file whose executable must be discovered via file association rules? Does that sound accurate? I'm not entirely sure what you mean by

triangle python user's group?

2010-08-30 Thread Tim Arnold
o find a locale convenient to Chapel Hill, Durham, Raleigh, Cary, and Apex. thanks, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: triangle python user's group?

2010-08-31 Thread Tim Arnold
"Albert Hopkins" wrote in message news:[email protected]... > On Mon, 2010-08-30 at 12:38 -0700, Tim Arnold wrote: >> Hi, >> Is there a python users group in the Research Triangle Park area >> (North Carolina, USA)? > >

Re: Source code for itertools

2010-08-31 Thread Tim Roberts
ironment? Did you take the time to understand what he did? It's not that hard to figure out. He fetched the Python source code, unpacked it, then search for filenames that contained the string "itertools." The equivalent in Windows, after unpacking the source archive, would have b

<    66   67   68   69   70   71   72   73   74   75   >