Re: ftp recursively

2008-03-19 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> ftping it as a flat file, and untarring it on the other side. Of >> course, the motivation wasn't just to get the files from point A to >> point B using Unix (which I already know how to do), but to take >> advantage of an opportunity

dividing tuple elements with an int or float

2008-03-19 Thread royG
hi i am trying to resize some images.First i'd read the size as a 2 tuple and then i want to divide it by 2 or 4 or 2.5 etc.. suppose origsz=(400,300) i want to divide the origsize by 2.5 so i can resize to (160,120) scale=2.5 how can i get the newsz? obviously origsz/2.5 won't work .. thanks R

Re: xml sax

2008-03-19 Thread Timothy Wu
Oh right, why didn't I think of that. =) Many thanks. Timothy On Thu, Mar 20, 2008 at 1:45 AM, Robert Bossy <[EMAIL PROTECTED]> wrote: > Timothy Wu wrote: > > Hi, > > > > I am using xml.sax.handler.ContentHandler to parse some simple xml. > > > > I want to detect be able to parse the content

Re: keeping state in an iterator object by rebinding next()

2008-03-19 Thread iteration . nth
On Mar 19, 3:36 pm, Wilbert Berendsen <[EMAIL PROTECTED]> wrote: > Hi, > > i am writing a simple parser, that generates tokens. The parser needs to > maintain some state, because some parts of the file consist of different > tokens. I thought the object could simply remember its state by assigning

Re: ADO error - large data set

2008-03-19 Thread Gyula
Ok. After several tries, I think I found out why it breaks and it has nothing to do with the number of records... Here is the code/ see notes below: # code starts here # First import wincom32 client from win32com.client import * # Create the ADO Connection object via COM

Re: [newbie] using ElementTree, how to add doctype and xml pi

2008-03-19 Thread Gabriel Genellina
En Wed, 19 Mar 2008 20:53:49 -0300, dave berk <[EMAIL PROTECTED]> escribió: > I have an svg file i'm creating on the fly. How do I add the doctype and > xml > pi? They're not an element per se, and there is no function to add them. The easiest way (but perhaps not-so-pure) is to just write th

Re: finding items that occur more than once in a list

2008-03-19 Thread Gabriel Genellina
En Wed, 19 Mar 2008 20:16:36 -0300, John Machin <[EMAIL PROTECTED]> escribió: > On Mar 20, 9:14 am, sturlamolden <[EMAIL PROTECTED]> wrote: >> Is a Python set implemented using a hash table? > > What don't you understand about the comments in the first two > screenfuls of Objects/setobject.c? T

Re: os.path.getsize() on Windows

2008-03-19 Thread Steven D'Aprano
On Wed, 19 Mar 2008 12:34:34 +, Duncan Booth wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >> This whole approach >> assumes that Windows does the sensible thing of returning a unique > error >> code when you try to open a file for reading that is already open for >> writing. >> >>

Re: Inserting DTD statement to XML

2008-03-19 Thread Gabriel Genellina
En Wed, 19 Mar 2008 15:33:19 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > I am new to Python and I am writing a script to build a XML document > and post it to a website. I have a working script but need to insert > a DTD statement in my XML document and can't find out how to do thi

Re: Improving datetime

2008-03-19 Thread Nicholas F. Fabry
On Mar 19, 2008, at 18:32, Steven D'Aprano wrote: On Wed, 19 Mar 2008 17:40:39 -0400, Nicholas F. Fabry wrote: To summarize my proposal VERY briefly: - Make aware datetime objects display in local time, but calculate/ compare in UTC. Your proposal is ambiguous. Wha

Re: finding items that occur more than once in a list

2008-03-19 Thread sturlamolden
On 20 Mar, 00:16, John Machin <[EMAIL PROTECTED]> wrote: > What don't you understand about the comments in the first two > screenfuls of Objects/setobject.c? I had not looked at it, but now I have. Is seems Hettinger is the author :) Ok, so sets are implemented as hash tables. Then I agree, use R

Re: ADO error - large data set

2008-03-19 Thread Gyula
Thanks! I will give it a try. It seems though that I get stuck on rs.Open that makes no sense. I was wondering about pagesize or other registry settings that might cause this? Will try to track down any bad data first... gg On Mar 19, 3:27 pm, "dsavitsk" <[EMAIL PROTECTED]> wrote: > Is it possible

Re: slicing a list but in downward fashion

2008-03-19 Thread Mensanator
On Mar 19, 6:37 pm, Lee Sander <[EMAIL PROTECTED]> wrote: > hi, > i have a list and i can get elements form it via slicing > L[start:stop] > but sometimes the start is > stop i.e. I want to go in the opposite > direction,eg > L[10:2], > > mattab lets you do L(10:-1:2) to achive this, is there a way

Re: Python to C/C++

2008-03-19 Thread Gabriel Genellina
En Wed, 19 Mar 2008 13:17:01 -0300, Blubaugh, David A. <[EMAIL PROTECTED]> escribió: > Has anyone worked with a translator that will translate python to c/c++ > source code? I know that there is already one translator of this nature > (shedskin compiler) out there. However, it is still in the

Re: is hash map data structure available in Python?

2008-03-19 Thread 7stud
On Mar 19, 2:40 am, grbgooglefan <[EMAIL PROTECTED]> wrote: > Hi, > I have a situation that I need to search a name in a big list of names > in my Python embedded interpreter. I am planning to use hash map for > quicker search. > How do I create hash map in Python? > Can you please guide me to some

[newbie] using ElementTree, how to add doctype and xml pi

2008-03-19 Thread dave berk
Hi all I have an svg file i'm creating on the fly. How do I add the doctype and xml pi? They're not an element per se, and there is no function to add them. Am I suppose to add them as elements after all? I have something like this: self.svgRoot = ET.Element("svg", xmlns=r'http://www.w3.org/2000

Re: add new csv line

2008-03-19 Thread Gabriel Genellina
En Wed, 19 Mar 2008 13:01:08 -0300, Alexandru Dumitrescu <[EMAIL PROTECTED]> escribió: > Is there a way to add a new line at the beginning of a *.csv file, > line which contain the name of the columns? Once the file was written? You have to create another file, write the headings, and copy

Re: Huge problem gettng MySQLdb to work on my mac mini running Macosx 10.5 Leopard

2008-03-19 Thread Graham Dumpleton
On Mar 19, 9:30 pm, geert <[EMAIL PROTECTED]> wrote: > On Mar 19, 2:26 am, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > > > On Mar 19, 9:47 am, geert <[EMAIL PROTECTED]> wrote: > > > > On Mar 18, 6:56 pm, geert <[EMAIL PROTECTED]> wrote: > > > > > On Mar 14, 1:15 pm, [EMAIL PROTECTED] wrote:

slicing a list but in downward fashion

2008-03-19 Thread Lee Sander
hi, i have a list and i can get elements form it via slicing L[start:stop] but sometimes the start is > stop i.e. I want to go in the opposite direction,eg L[10:2], mattab lets you do L(10:-1:2) to achive this, is there a way to do this in python? thanks L -- http://mail.python.org/mailman/listin

Re: finding items that occur more than once in a list

2008-03-19 Thread John Machin
On Mar 20, 9:14 am, sturlamolden <[EMAIL PROTECTED]> wrote: > On 19 Mar, 22:48, John Machin <[EMAIL PROTECTED]> wrote: > > > I'd use Raymond Hettinger's solution. It is as much O(N) as Paul's, > > and is IMHO more readable than Paul's. > > Is a Python set implemented using a hash table? What don't

Re: csv.Sniffer - delete in Python 3.0?

2008-03-19 Thread Gabriel Genellina
En Wed, 19 Mar 2008 12:44:05 -0300, <[EMAIL PROTECTED]> escribió: > The csv module contains a Sniffer class which is supposed to deduce the > delimiter and quote character as well as the presence or absence of a > header > in a sample taken from the start of a purported CSV file. I no longer >

Re: finding items that occur more than once in a list

2008-03-19 Thread John Machin
On Mar 20, 9:57 am, Justin Bozonier <[EMAIL PROTECTED]> wrote: > On Mar 19, 2:48 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > > On Mar 19, 10:08 am, sturlamolden <[EMAIL PROTECTED]> wrote: > > > > On 18 Mar, 23:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > > > > > def nonunique(lst): >

Re: finding items that occur more than once in a list

2008-03-19 Thread Justin Bozonier
On Mar 19, 2:48 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Mar 19, 10:08 am, sturlamolden <[EMAIL PROTECTED]> wrote: > > > > > On 18 Mar, 23:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > > > > def nonunique(lst): > > > >slst = sorted(lst) > > > >dups = [s[0] for s in > > > >

Re: keeping state in an iterator object by rebinding next()

2008-03-19 Thread Terry Reedy
"Wilbert Berendsen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi, | | i am writing a simple parser, that generates tokens. The parser needs to | maintain some state, because some parts of the file consist of different | tokens. I thought the object could simply remember its st

Re: URLError

2008-03-19 Thread Steven D'Aprano
On Wed, 19 Mar 2008 14:45:39 -0700, Jim wrote: > Program randomly aborts when looking up url. The program loop thru > 4000+ records looking > up ID via internet and returns html code which is used in subsequent > processing. The code > for looking-up record is below followed by abort details. Can

Re: removing all instances of a certain value from a list

2008-03-19 Thread Hrvoje Niksic
Lee Sander <[EMAIL PROTECTED]> writes: > Hi, > I have a float array ( eg [-1.3, 1.22, 9.2, None, 2.3] ) but there are > many missing vlaues which are represented as None. I would like to > remove all such instances in one go. > There is a remove function but it removes only the first instance, is

Re: removing all instances of a certain value from a list

2008-03-19 Thread BJörn Lindqvist
On Wed, Mar 19, 2008 at 10:28 PM, Lee Sander <[EMAIL PROTECTED]> wrote: > Hi, > I have a float array ( eg [-1.3, 1.22, 9.2, None, 2.3] ) but there are > many missing vlaues which are represented as None. I would like to > remove all such instances in one go. > There is a remove function but it

Re: Improving datetime

2008-03-19 Thread Steven D'Aprano
On Wed, 19 Mar 2008 17:40:39 -0400, Nicholas F. Fabry wrote: > To summarize my proposal VERY briefly: > > > - Make aware datetime objects display in local time, but calculate/ > compare in UTC. Your proposal is ambiguous. What does that mean? Can you give an example? > - Raise exceptions wh

Re: printing dictionary and tuple

2008-03-19 Thread Gabriel Genellina
En Wed, 19 Mar 2008 08:16:52 -0300, Beema shafreen <[EMAIL PROTECTED]> escribió: > i am trying to print the dictionary values and tuple in a same line as > below > > print "\t".join(dict[a].values())+'\t'+"\t".join(b) > > Error I get is the TypeError, > since i have misisng values in the di

removing all instances of a certain value from a list

2008-03-19 Thread Lee Sander
Hi, I have a float array ( eg [-1.3, 1.22, 9.2, None, 2.3] ) but there are many missing vlaues which are represented as None. I would like to remove all such instances in one go. There is a remove function but it removes only the first instance, is there a delete/remove all function? thanks -- htt

Re: ADO error - large data set

2008-03-19 Thread dsavitsk
Is it possible there is some bad data in the larger db? This is asinine, but maybe write a small script that adds some data, then opens and closes the db, then repeats this. If this is a size issue, then you can at least narrow it down to where the size limit is? And, if it isn't you should be a

Re: finding items that occur more than once in a list

2008-03-19 Thread sturlamolden
On 19 Mar, 22:48, John Machin <[EMAIL PROTECTED]> wrote: > I'd use Raymond Hettinger's solution. It is as much O(N) as Paul's, > and is IMHO more readable than Paul's. Is a Python set implemented using a hash table? -- http://mail.python.org/mailman/listinfo/python-list

Re: Improving datetime

2008-03-19 Thread Christian Heimes
Nicholas F. Fabry schrieb: > Thank you for the prompt response and suggestion! I am writing up a > proposal presently. There are, however, two broad category of changes > - the 'easy' changes, which could be accomplished with little > additional effort, and the 'hard' changes, which would r

Re: Is this valid ?

2008-03-19 Thread John Machin
On Mar 20, 8:18 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > by accident I typed a double value test, > and to my surprise it seems to work. > Is this valid ? > > a = 2 > b = 2 > > a == b == 2 > Of course. You can chain comparisons as much as you like and is (semi-)sensible, e.g. asse

Re: is hash map data structure available in Python?

2008-03-19 Thread Terry Reedy
"sturlamolden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On 19 Mar, 09:40, grbgooglefan <[EMAIL PROTECTED]> wrote: | | > How do I create hash map in Python? | | Python dictionaries are the fastest hash maps known to man. If you only have keys (the names) and no values attache

Re: finding items that occur more than once in a list

2008-03-19 Thread John Machin
On Mar 19, 10:08 am, sturlamolden <[EMAIL PROTECTED]> wrote: > On 18 Mar, 23:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > > > def nonunique(lst): > > >slst = sorted(lst) > > >dups = [s[0] for s in > > > filter(lambda t : t[0] == t[1], zip(slst[:-1],slst[1:]))] > > >return

URLError

2008-03-19 Thread Jim
Program randomly aborts when looking up url. The program loop thru 4000+ records looking up ID via internet and returns html code which is used in subsequent processing. The code for looking-up record is below followed by abort details. Can anyone help with catching the abort before program aborts

Re: Improving datetime

2008-03-19 Thread Nicholas F. Fabry
On Mar 19, 2008, at 16:30, Christian Heimes wrote: > Nicholas F. Fabry schrieb: >> This is a query for information as to how to proceed. I am not a >> professional programmer, but I use Python a great deal to help me >> in my main job, which involves designing schedules for a global >> ai

Re: Script Request...

2008-03-19 Thread some one
Thanks Diez, I found some docs and examples on urllib2. Now how do i search the string I get from urllib2, lets say I put it in "myURL", How do I search for only Numbers and ".'s" in the "#.#.#.#" pattern. That is all I am interested in with all the data retrieved. Just the IP Address from a

Re: Is this valid ?

2008-03-19 Thread Gary Herron
Stef Mientki wrote: > hello, > > by accident I typed a double value test, > and to my surprise it seems to work. > Is this valid ? > > a = 2 > b = 2 > > a == b == 2 > > thanks, > Stef Mientki > > Yes. It's been in Python since the earliest days. You usually see it in test like this: if a <

Re: Is this valid ?

2008-03-19 Thread Mike Driscoll
On Mar 19, 4:18 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > by accident I typed a double value test, > and to my surprise it seems to work. > Is this valid ? > > a = 2 > b = 2 > > a == b == 2 > > thanks, > Stef Mientki It sure looks that way... See http://www.python.org/doc/2.3.5/ref

Fate of the repr module in Py3.0

2008-03-19 Thread Raymond Hettinger
Was looking at PEP 3108, http://www.python.org/dev/peps/pep-3108/ , and saw that the repr module was slated for vaporization. I've only used the module a few times ever. I'm curious if the community wants it kept around or whether it is considered clutter. The PEP is going to be finalized soon,

Is this valid ?

2008-03-19 Thread Stef Mientki
hello, by accident I typed a double value test, and to my surprise it seems to work. Is this valid ? a = 2 b = 2 a == b == 2 thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: keeping state in an iterator object by rebinding next()

2008-03-19 Thread Peter Otten
Wilbert Berendsen wrote: > Hi, > > i am writing a simple parser, that generates tokens. The parser needs to > maintain some state, because some parts of the file consist of different > tokens. I thought the object could simply remember its state by assigning > it's next() method to the method tha

Re: What Programming Languages Should You Learn Next?

2008-03-19 Thread sturlamolden
On 19 Mar, 09:44, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Could you elaborate on this? (Sincere question; I have almost no > idea of Haskell.) If you already know Python, you will find Whitespace just as useful as Haskell. -- http://mail.python.org/mailman/listinfo/python-list

Re: Prototype OO

2008-03-19 Thread Marc 'BlackJack' Rintsch
On Wed, 19 Mar 2008 17:59:40 +0100, sam wrote: > Can someone tell me why class-based OO is better that Prototype based, > especially in scripting langage with dynamic types as Python is? Is it better!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-lis

Re: Improving datetime

2008-03-19 Thread Christian Heimes
Nicholas F. Fabry schrieb: > This is a query for information as to how to proceed. I am not a > professional programmer, but I use Python a great deal to help me in > my main job, which involves designing schedules for a global airline. > As such, I use datetime (and dateutil) extensively,

Re: Anomaly in time.clock()

2008-03-19 Thread John Machin
On Mar 19, 11:17 pm, Godzilla <[EMAIL PROTECTED]> wrote: > Hi John, > > I am using time.clock to calculate the elapsed time. Below is an > example of what I was trying to do: > > import time > import thread Silly me, not being able to infer that from your initial post! [snip] > > But the time.clo

Re: Calling Mac programs from Python instead of from AppleScript

2008-03-19 Thread Kevin Walzer
[EMAIL PROTECTED] wrote: > When I'm running Script Editor, I can get Maya to draw a sphere by > typing: > > tell application "Maya" > execute "sphere" > end tell > > When I try this using Python, I get this error message: > > IDLE 1.2.2 app('Maya').execute('sphere') > > Traceback (mo

Re: Search the command history - Python Shell

2008-03-19 Thread Gabriel Genellina
En Wed, 19 Mar 2008 07:07:50 -0300, Tim Chase <[EMAIL PROTECTED]> escribió: >> Are there any simillar key combination in Python Shell like Linux Ctrl+R >> (reverse-i-search) to search the command history? > > It must depend on how your version of Python was built...mine > here on my Linux box ha

Re: csv dictreader

2008-03-19 Thread Mike Driscoll
On Mar 19, 1:55 pm, brnstrmrs <[EMAIL PROTECTED]> wrote: > On Mar 19, 2:32 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > > > On Mar 19, 1:06 pm, brnstrmrs <[EMAIL PROTECTED]> wrote: > > > > I am trying to use the dictionary reader to import the data from a csv > > > file and create a dictnary

Calling Mac programs from Python instead of from AppleScript

2008-03-19 Thread dvschorre
When I'm running Script Editor, I can get Maya to draw a sphere by typing: tell application "Maya" execute "sphere" end tell When I try this using Python, I get this error message: IDLE 1.2.2 >>> app('Maya').execute('sphere') Traceback (most recent call last): File "", line 1, in

Re: How to solve a three-element equation set?

2008-03-19 Thread Gabriel Genellina
En Wed, 19 Mar 2008 04:05:50 -0300, purple <[EMAIL PROTECTED]> escribió: > Could you guys do me a favor for solving a equation set? > > Z=d/4*(1-SIN(X)/X) > X=8q/(D^2*Y)+SIN(X) > Y=1/n*Z^(2/3)*i^(1/2) > > In this equation set, X,Y&Z are the unkown parameters, the others say, > d, q, n&i are known.

keeping state in an iterator object by rebinding next()

2008-03-19 Thread Wilbert Berendsen
Hi, i am writing a simple parser, that generates tokens. The parser needs to maintain some state, because some parts of the file consist of different tokens. I thought the object could simply remember its state by assigning it's next() method to the method that is currently parsing. When the st

Re: automatically doing some cleaning-up by the process when the systems shuts down

2008-03-19 Thread Gabriel Genellina
En Wed, 19 Mar 2008 04:28:19 -0300, bharath venkatesh <[EMAIL PROTECTED]> escribió: > handling SIGTERM allowed me to do cleaning up while the system shuts > down > but as i mentioned previously how can my process know if the system > was > not shut down properly previously Sorry about t

Re: Tkinter.Text widget - how to get text cursor position?

2008-03-19 Thread Alex9968
Alex9968 wrote: > Is it possible to get position (in numbers) of the insertion cursor? As > I understood, Text widget uses mark named INSERT to store it, which is > available globally by just referencing INSERT, but how could I get > actual coordinate numbers of the mark? > I need this because I

Re: csv dictreader

2008-03-19 Thread brnstrmrs
On Mar 19, 2:32 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Mar 19, 1:06 pm, brnstrmrs <[EMAIL PROTECTED]> wrote: > > > > > I am trying to use the dictionary reader to import the data from a csv > > file and create a dictnary from it but just can't seem to figure it > > out. > > > Here is my

Inserting DTD statement to XML

2008-03-19 Thread [EMAIL PROTECTED]
I am new to Python and I am writing a script to build a XML document and post it to a website. I have a working script but need to insert a DTD statement in my XML document and can't find out how to do this. I am using "from xml.dom.minidom import Document" Some code I am using is: doc =

Re: csv dictreader

2008-03-19 Thread Mike Driscoll
On Mar 19, 1:06 pm, brnstrmrs <[EMAIL PROTECTED]> wrote: > I am trying to use the dictionary reader to import the data from a csv > file and create a dictnary from it but just can't seem to figure it > out. > > Here is my code: > > >>>import csv > >>>reader = csv.DictReader(open('table.csv')) > >>>

Re: modules devoted to manipulationg .reg files

2008-03-19 Thread Mike Driscoll
On Mar 19, 1:14 pm, black_13 <[EMAIL PROTECTED]> wrote: > are there any python modules for manipulation of .reg files producted > by > the win32 prog "reg". > thanks. > black_13 The *.reg files are text files, so you can parse them like any text file. You can just edit the Windows Registry directl

Re: Is there a way to get __thismodule__?

2008-03-19 Thread benhoyt
Wow -- thanks, guys. And who said Python only gives you one way to do things. :-) Metaclasses, globals(), and __subclasses__. Thank Duncan for the __subclassess__ tip -- I didn't know about that. I'd totally overlooked globals(). It's exactly what I was looking for -- thanks, Peter. And I like yo

modules devoted to manipulationg .reg files

2008-03-19 Thread black_13
are there any python modules for manipulation of .reg files producted by the win32 prog "reg". thanks. black_13 -- http://mail.python.org/mailman/listinfo/python-list

csv dictreader

2008-03-19 Thread brnstrmrs
I am trying to use the dictionary reader to import the data from a csv file and create a dictnary from it but just can't seem to figure it out. Here is my code: >>>import csv >>>reader = csv.DictReader(open('table.csv')) >>>for row in reader: >>>print row my csv files looks like this: Bytecode,E

Re: how to remove suffix from filename

2008-03-19 Thread Larry Bates
royG wrote: > hi > when parsing a list of filenames like ['F:/mydir/one.jpg','F:/mydir/ > two.jpg'] etc i want to extract the > basename without the suffix...ie i want to get 'one','two' etc and not > 'one.jpg' > > is there a function in python to do this or do i have tosplit it ..? > thanks >

Re: xml sax

2008-03-19 Thread Robert Bossy
Timothy Wu wrote: > Hi, > > I am using xml.sax.handler.ContentHandler to parse some simple xml. > > I want to detect be able to parse the content of this tag embedded in > the XML. > 174 > > > Is the proper way of doing so involving finding the "Id" tag > from startElement(), setting flag when s

Tkinter.Text widget - how to get text cursor position?

2008-03-19 Thread Alex9968
Is it possible to get position (in numbers) of the insertion cursor? As I understood, Text widget uses mark named INSERT to store it, which is available globally by just referencing INSERT, but how could I get actual coordinate numbers of the mark? I need this because I want not just to insert s

Re: Anomaly in time.clock()

2008-03-19 Thread Ross Ridge
Godzilla <[EMAIL PROTECTED]> wrote: >But the time.clock() sometimes return a value of between -3.5 to -4.5 >seconds backward. There are race conditions in your code. In between the time you execute "curTime = time.clock()" and calculate "curTime - self.timeStamp" in one thread, the other thread

Python to C/C++

2008-03-19 Thread Patrick Mullen
(sorry michael, didn't mean to personal post On Wed, Mar 19, 2008 at 9:24 AM, Michael Wieher wrote: > I think py2exe does this, but it might be a bit bloated No, py2exe basically bundles the main script and the interpreter together so it's easy to run and requires no python installation. Loo

Re: How to get an XML DOM while offline?

2008-03-19 Thread Paul Boddie
On 19 Mar, 16:27, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > william tanksley wrote: > > I want to parse my iTunes Library xml. All was well, until I unplugged > > and left for the train (where I get most of my personal projects > > done). All of a sudden, I discovered that apparently the pres

Re: Using threads in python is safe ?

2008-03-19 Thread Gabriel Genellina
En Wed, 19 Mar 2008 04:43:34 -0300, Deepak Rokade <[EMAIL PROTECTED]> escribió: > Thanks all for removing confusion about GIL, > one more question; > If jobs to be processed by threds is I/O bound would multithreading help > python to improve speed of application ? > Since I read that " multithr

Re: Need Help Starting Out

2008-03-19 Thread Peter Decker
On Tue, Mar 18, 2008 at 11:10 AM, jmDesktop <[EMAIL PROTECTED]> wrote: > Hi, I would like to start using Python, but am unsure where to begin. > I know how to look up a tutorial and learn the language, but not what > all technologies to use. I saw references to plain Python, Django, > and other

Latest updates inSQL server and other programming laguages like C++/Java

2008-03-19 Thread Gokul
The latest developments in SQL server 2008 and an complete encyclopedia of microsoft softwares. Know the methodology to capture customers requirements for new products. Get the latest development in C++ and other IT related tools. A complete tutor for all your IT needs. Visit http://www.sqlservers

Prototype OO

2008-03-19 Thread sam
Some time ago (2004) there were talks about prototype-based languages and Prothon emerged. Can someone tell me why class-based OO is better that Prototype based, especially in scripting langage with dynamic types as Python is? Here are some links: http://c2.com/cgi/wiki?PrototypeBasedProgram

Re: csv.Sniffer - delete in Python 3.0?

2008-03-19 Thread Robin Becker
[EMAIL PROTECTED] wrote: > > I would be happy to get rid of it in 3.0, but I'm also aware that some > people use it. I'd like feedback from the Python community about this. If > I removed it is there someone out there who wants it badly enough to > maintain it in PyPI? .. sounds lik

Re: Python to C/C++

2008-03-19 Thread Michael Wieher
I think py2exe does this, but it might be a bit bloated 2008/3/19, Blubaugh, David A. <[EMAIL PROTECTED]>: > > To All, > > Has anyone worked with a translator that will translate python to c/c++ > source code? I know that there is already one translator of this nature > (shedskin > compiler) ou

Re: url validator in python

2008-03-19 Thread Tim Chase
> How can I check the validity of absolute urls with http scheme? > example: > "http://www.example.com/something.html"; -> valid > "http://www.google.com/ + Brite_AB_Iframe_URL + " -> invalid You could try something like import urllib tests = ( ("http://www.google.com/ + Brite_AB_Ifram

Python to C/C++

2008-03-19 Thread Blubaugh, David A.
To All, Has anyone worked with a translator that will translate python to c/c++ source code? I know that there is already one translator of this nature (shedskin compiler) out there. However, it is still in the beta stage of development. Does anyone know of a more developed version of a transl

ADO error - large data set

2008-03-19 Thread Gyula
Hi there, I have been running Python to tap into an MS Access 2003 database using ADO (PythonWin+COM). Everything works great creating recordsets etc. when I open a table with a small number of records. However, when I try to run the same Python code with a large table (>100,000) I get: Traceback

add new csv line

2008-03-19 Thread Alexandru Dumitrescu
Hello everybody, Is there a way to add a new line at the beginning of a *.csv file, line which contain the name of the columns? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to remove suffix from filename

2008-03-19 Thread Mel
royG wrote: > when parsing a list of filenames like ['F:/mydir/one.jpg','F:/mydir/ > two.jpg'] etc i want to extract the > basename without the suffix...ie i want to get 'one','two' etc and not > 'one.jpg' > > is there a function in python to do this or do i have tosplit it ..? > thanks os.pa

Re: is hash map data structure available in Python?

2008-03-19 Thread sturlamolden
On 19 Mar, 09:40, grbgooglefan <[EMAIL PROTECTED]> wrote: > How do I create hash map in Python? Python dictionaries are the fastest hash maps known to man. If you need persistent storage of your hash map, consider module bsddb or dbhash. -- http://mail.python.org/mailman/listinfo/python-list

how to remove suffix from filename

2008-03-19 Thread royG
hi when parsing a list of filenames like ['F:/mydir/one.jpg','F:/mydir/ two.jpg'] etc i want to extract the basename without the suffix...ie i want to get 'one','two' etc and not 'one.jpg' is there a function in python to do this or do i have tosplit it ..? thanks RG -- http://mail.python.or

url validator in python

2008-03-19 Thread vvangelovski
How can I check the validity of absolute urls with http scheme? example: "http://www.example.com/something.html"; -> valid "http://www.google.com/ + Brite_AB_Iframe_URL + " -> invalid -- http://mail.python.org/mailman/listinfo/python-list

csv.Sniffer - delete in Python 3.0?

2008-03-19 Thread skip
The csv module contains a Sniffer class which is supposed to deduce the delimiter and quote character as well as the presence or absence of a header in a sample taken from the start of a purported CSV file. I no longer remember who wrote it, and I've never been a big fan of it. It determines the

Re: cx_Oracle execute procedure

2008-03-19 Thread Poppy
Thanks Jerry and Diez. The first two replies I found answered my noob question. "Jerry Hill" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, Mar 19, 2008 at 11:03 AM, Poppy <[EMAIL PROTECTED]> > wrote: >> I've been working on the code below and and executes silently, no >

Re: SOAP Server in Python

2008-03-19 Thread Eric
On Mar 19, 10:59 am, [EMAIL PROTECTED] wrote: > On Mar 19, 9:19 am, Eric <[EMAIL PROTECTED]> wrote: > > > I am basically looking to do the same thing in Python as easily. > > > Any help or pointers would be appreciated. > > Googling for "python soap" turned up a few hits that may help you. Yes, bu

Re: SOAP Server in Python

2008-03-19 Thread Eric
On Mar 19, 10:59 am, [EMAIL PROTECTED] wrote: > On Mar 19, 9:19 am, Eric <[EMAIL PROTECTED]> wrote: > > > I am basically looking to do the same thing in Python as easily. > > > Any help or pointers would be appreciated. > > Googling for "python soap" turned up a few hits that may help you. Yes, bu

Re: cx_Oracle execute procedure

2008-03-19 Thread Diez B. Roggisch
Poppy wrote: > I've been working on the code below and and executes silently, no > complaints, however the end result should be a record in my table and it's > not added. The procedure works with the passed credentials using SQLPlus > or SQL Developer clients. However I'm not sure if I'm construct

Re: How to get an XML DOM while offline?

2008-03-19 Thread Diez B. Roggisch
william tanksley wrote: > I want to parse my iTunes Library xml. All was well, until I unplugged > and left for the train (where I get most of my personal projects > done). All of a sudden, I discovered that apparently the presence of a > DOCTYPE in the iTunes XML makes xml.dom.minidom insist on a

Re: Improving datetime

2008-03-19 Thread Preston Landers
On Mar 19, 9:12 am, "Nicholas F. Fabry" <[EMAIL PROTECTED]> wrote: > So - where should I propose these changes?  Here?  python-dev?  Should   > I write up a full PEP or should I just give a more informal outline   > with code samples?   My guess is that the python-dev folks would send you here or

Re: Speaking Text

2008-03-19 Thread Grant Edwards
On 2008-03-19, David C Ullrich <[EMAIL PROTECTED]> wrote: > Mac OS X has text-to-speech built into the interface. > So there must be a way to access that from the command > line as well - in fact the first thing I tried worked: > > os.system('say hello') > > says 'hello'. > > Is there something si

Re: cx_Oracle execute procedure

2008-03-19 Thread Jerry Hill
On Wed, Mar 19, 2008 at 11:03 AM, Poppy <[EMAIL PROTECTED]> wrote: > I've been working on the code below and and executes silently, no > complaints, however the end result should be a record in my table and it's > not added. The procedure works with the passed credentials using SQLPlus or > SQL

How to get an XML DOM while offline?

2008-03-19 Thread william tanksley
I want to parse my iTunes Library xml. All was well, until I unplugged and left for the train (where I get most of my personal projects done). All of a sudden, I discovered that apparently the presence of a DOCTYPE in the iTunes XML makes xml.dom.minidom insist on accessing the Internet... So sudde

cx_Oracle execute procedure

2008-03-19 Thread Poppy
I've been working on the code below and and executes silently, no complaints, however the end result should be a record in my table and it's not added. The procedure works with the passed credentials using SQLPlus or SQL Developer clients. However I'm not sure if I'm constructing my python code

Re: SOAP Server in Python

2008-03-19 Thread dave_mikesell
On Mar 19, 9:19 am, Eric <[EMAIL PROTECTED]> wrote: > I am basically looking to do the same thing in Python as easily. > > Any help or pointers would be appreciated. Googling for "python soap" turned up a few hits that may help you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Improving datetime

2008-03-19 Thread Mike Driscoll
On Mar 19, 9:12 am, "Nicholas F. Fabry" <[EMAIL PROTECTED]> wrote: > This is a query for information as to how to proceed. I am not a > professional programmer, but I use Python a great deal to help me in > my main job, which involves designing schedules for a global airline. > As such, I use date

Improving datetime

2008-03-19 Thread Nicholas F. Fabry
This is a query for information as to how to proceed. I am not a professional programmer, but I use Python a great deal to help me in my main job, which involves designing schedules for a global airline. As such, I use datetime (and dateutil) extensively, and after much use, I have come t

Re: changing names of items in a list

2008-03-19 Thread Simon Brunning
On Wed, Mar 19, 2008 at 2:21 PM, royG <[EMAIL PROTECTED]> wrote: > hi > i am trying to rename extension of files in a directory..as an initial > step i made a method in > > class ConvertFiles: > def __init__(self,infldr,outfldr): > self.infldr=infldr > self.outfldr

Re: changing names of items in a list

2008-03-19 Thread Diez B. Roggisch
royG wrote: > hi > i am trying to rename extension of files in a directory..as an initial > step i made a method in > > class ConvertFiles: > def __init__(self,infldr,outfldr): > self.infldr=infldr > self.outfldr=outfldr > self.origlist=os.listdir(infld

Generalizing PEP 370 (per user site-packages directory) via .pth files

2008-03-19 Thread ago
Dear all, I was reading pep 370, "Per user site-packages directory" http://www.python.org/dev/peps/pep-0370/, and was wondering if the concept couldn't be generalized by having ways to pass a .pth file as commandline argument and/or via an environment variable (PYTHONPATH could also be used to fee

  1   2   >