PyODB v0.7 Released

2008-05-21 Thread Neil Moses
I would like to announce release 0.7 of PyODB. This release fixes a problem with Ubuntu Hardy 8.04 (64bit). When running an ODBC query using FreeTDS with a connection to MS SQL 2005 caused the fetch from a column containing a string value to return an empty (null) result. Many thanks to Jaco Du

Re: Removing Space and - from a string

2008-05-21 Thread inhahe
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Shakir, I have thousands of records in MS Access database table, which records I am fetching using python script. One of the columns having string like '8 58-2155-58' Desired output: '858215558' I want to remove any spaces

Re: Python's doc problems: sort

2008-05-21 Thread alex23
On May 21, 8:53 am, Xah Lee [EMAIL PROTECTED] wrote: The complaint about python doc has turned up now and then in the past few years it seems, but always got put down by python priests No, what was generally rejected was the idea that *you* could bring more clarity to the documentation, based

Re: feature proposal, debug on exception

2008-05-21 Thread Ville M. Vainio
Simon Forman [EMAIL PROTECTED] writes: This is not exactly an answer to your proposal, I know, but FWIW Ipython has exactly this capability. Yes. When you %run a scripts and get exception, you can launch post-mortem pdb on it by typing %debug. --

Re: default gettext localedir on windows

2008-05-21 Thread ZeeGeek
On May 21, 2:31 am, Thorsten Kampe [EMAIL PROTECTED] wrote: * ZeeGeek (Tue, 20 May 2008 09:31:27 -0700 (PDT)) On May 17, 8:39 pm, Thorsten Kampe [EMAIL PROTECTED] wrote: * ZeeGeek (Sun, 4 May 2008 10:56:52 -0700 (PDT)) On May 5, 1:16 am, Thorsten Kampe [EMAIL PROTECTED] wrote: *

online computer shops

2008-05-21 Thread rema.khan
* Drives Writers, * Hard Drives Storage, * Headphones Mics, * Internet / Internet Telephony, * Keyboards Mouse, * Memory / RAM, * Memory Card Readers, * Modems, * TV Tuner Cards, * UPS, * USB Devices, * WebCams, * Wireless

Re: persistent deque

2008-05-21 Thread inhahe
i don't know how i would get around the problem, though, because i'd have to know how to access the deque object that my class stores when i do deque.__init__ in my constructor, so that i could pickle it and my class variables separately. i decided i could just pickle deque(self), which

Re: Processing in Python

2008-05-21 Thread Diez B. Roggisch
Istvan Albert schrieb: On May 20, 6:13 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: Salvatore DI DI0 schrieb: Hello, The Processing Graphics language has been implemented in Javascript. No, it hasn't. Processing is written in Java. He meant it has been re-implemented in Javascript:

Re: Access to sysctl on FreeBSD?

2008-05-21 Thread Thomas Heller
Skye schrieb: Great, thanks for the help (I'm fairly new to Python, didn't know about ctypes) from ctypes import * libc = CDLL(libc.so.7) size = c_uint(0) libc.sysctlbyname(net.inet.ip.stats, None, byref(size), None, 0) buf = c_char_p( * size.value)

Running programs under a python program...

2008-05-21 Thread [EMAIL PROTECTED]
So I have a python program that runs a bunch of other programsit then loops forever, occasionally executing other programs. To run each of these programs my python code executes: subprocess.Popen(command_line, shell=True, stdout=fd, stderr=subprocess.STDOUT) where command_line is an

Re: iterate start at second row in file not first

2008-05-21 Thread Paul Hankin
On May 20, 7:34 pm, [EMAIL PROTECTED] wrote: i have a big file with sentences, the first file of each sentence contains a colon(:) somewher eon that line i want to jump past that sentence. if all(x != ':' for x in line): this way i  can check but i dont want to check for every line in the

Re: Removing Space and - from a string

2008-05-21 Thread Paul Hankin
On May 20, 5:02 pm, Ahmed, Shakir [EMAIL PROTECTED] wrote: I have thousands of records in MS Access database table, which records I am fetching using python script. One of the columns having string like '8 58-2155-58' Desired output: '858215558' I want to remove any spaces between string

Re: Running programs under a python program...

2008-05-21 Thread inhahe
maybe you could instead of killing the program stop the loop that starts new processes and start one that runs until the last process ends? also, if you killed the program but stdout was still set to fd and stderr was still set to subprocesses.STDOUT, what would happen when those two objects

xpath with big files

2008-05-21 Thread Vladimir Kropylev
Hi, I've encountered a problem when trying to use lxml.etree.xpath with big (63Mb) file. It returns empty list on any request. Is there any restriction on file size for lxml.etree.xpath? This is what I do: f=open(filename) tree = etree.parse(f) f.close() r = tree.xpath('//image') print(r) it

Re: What is wrong with my Python threading?

2008-05-21 Thread Chuckk Hubbard
On Tue, May 20, 2008 at 4:28 PM, castironpi [EMAIL PROTECTED] wrote: On May 20, 8:19 am, Chuckk Hubbard [EMAIL PROTECTED] wrote: #!/usr/bin/python #why doesn't this run both threads simultaneously? #Thanks for any help. #Chuckk import threading import time def printesc(thrd): for

Re: Processing in Python

2008-05-21 Thread Salvatore DI DI0
He meant it has been re-implemented in Javascript: Indeed :-) There is a jython based NodeBox that runs on windows that can be found here: http://research.nodebox.net/index.php/NodeBoxDev Thank you -- http://mail.python.org/mailman/listinfo/python-list

getting dir(x), but not as list of strings?

2008-05-21 Thread mh
I want to iterate over members of a module, something like: for i in dir(x): if type(i) == types.FunctionType: ... but of course dir() returns a list of strings. If x is a module, how can I get the list of its members as their actual types? Many TIA! Mark -- Mark Harrison Pixar

Re: Processing in Python

2008-05-21 Thread Salvatore DI DI0
Thanks all of you Regards Salvatore -- http://mail.python.org/mailman/listinfo/python-list

Re: getting dir(x), but not as list of strings?

2008-05-21 Thread Marc 'BlackJack' Rintsch
On Wed, 21 May 2008 07:54:32 +, mh wrote: I want to iterate over members of a module, something like: for i in dir(x): if type(i) == types.FunctionType: ... but of course dir() returns a list of strings. If x is a module, how can I get the list of its members as their

HTMLParser error

2008-05-21 Thread jonbutler88
Just writing a simple website spider in python, keep getting these errors, not sure what to do. The problem seems to be in the feed() function of htmlparser. Traceback (most recent call last): File spider.py, line 38, in module s.crawl(site) File spider.py, line 30, in crawl

Re: iterate start at second row in file not first

2008-05-21 Thread Chris
On May 20, 8:34 pm, [EMAIL PROTECTED] wrote: i have a big file with sentences, the first file of each sentence contains a colon(:) somewher eon that line i want to jump past that sentence. if all(x != ':' for x in line): this way i can check but i dont want to check for every line in the

Typeerror

2008-05-21 Thread Beema shafreen
Hi all, I getting the following error when i run my scirpt , can somebody help me regarding this to solve the type error problem Traceback (most recent call last): File get_one_prt_pep.py, line 59, in ? if len(data[res])=1: TypeError: string indices must be integers -- Beema Shafreen --

Print HTML from Python

2008-05-21 Thread Jorgen Bodde
Hi All, I am at a loss. This is slightly OT because it concerns Windows and HTML printing. I would like to print a HTML document from Python, but not showing the printing dialog. After numerous searches and trials I came to the conclusion that ShellExecute with the print command and a HTML

Re: Typeerror

2008-05-21 Thread Freaky Chris
This is a simple error, you are passing the variable res as an interger to use for a slice when what ever you are storing in res isn't an integer. Chris Beema shafreen wrote: Hi all, I getting the following error when i run my scirpt , can somebody help me regarding this to solve the type

Re: scalable xml

2008-05-21 Thread Diez B. Roggisch
hyperboreean wrote: Hi, I am writing the application server for a three-tier architecture and sending the client's response in xml. My question is: is there a way to build the xml dom in a more scalable way and faster way than just creating every textNode and element for it? I have tons of

Re: Python in non-standard location erring with No module named _sha256

2008-05-21 Thread Laurent Rahuel
Maybe you run the configure, make, make install without addind devel packages on your system. I mean: openssl-devel readline-devel ... Regards, emallove wrote: I'm running into the below No modules named _sha256 issue, with a python installed in a non-standard location. $ python Python

Re: Typeerror

2008-05-21 Thread Beema shafreen
Thanks a lot i had solved the problem On Wed, May 21, 2008 at 2:32 PM, [EMAIL PROTECTED] wrote: On May 21, 9:58 am, Freaky Chris [EMAIL PROTECTED] wrote: This is a simple error, you are passing the variable res as an interger to use for a slice when what ever you are storing in res isn't

scalable xml

2008-05-21 Thread hyperboreean
Hi, I am writing the application server for a three-tier architecture and sending the client's response in xml. My question is: is there a way to build the xml dom in a more scalable way and faster way than just creating every textNode and element for it? I have tons of data to transmit and it

How to transfer files over serial?

2008-05-21 Thread RaymondHe
I want to transfer files over serial,but PySerial Module does not support any protocol such as xmodem/ymodem,and I find nothing about these protocol write in python What should I do?Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: Typeerror

2008-05-21 Thread jonbutler88
On May 21, 9:58 am, Freaky Chris [EMAIL PROTECTED] wrote: This is a simple error, you are passing the variable res as an interger to use for a slice when what ever you are storing in res isn't an integer. Chris Beema shafreen wrote: Hi all, I getting the following error when i run my

Re: HTMLParser error

2008-05-21 Thread jonbutler88
On May 21, 9:53 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Wed, 21 May 2008 01:18:00 -0700 (PDT), [EMAIL PROTECTED] declaimed the following in comp.lang.python: Any ideas of how to fix this? Im using python 2.5.2 on mac osx         In the absence of minimal runable code reproducing

C-like assignment expression?

2008-05-21 Thread boblatest
Hello, I have an if-elif chain in which I'd like to match a string against several regular expressions. Also I'd like to use the match groups within the respective elif... block. The C-like idiom that I would like to use is this: if (match = my_re1.match(line): # use match elsif (match =

Re: C-like assignment expression?

2008-05-21 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Hello, I have an if-elif chain in which I'd like to match a string against several regular expressions. Also I'd like to use the match groups within the respective elif... block. The C-like idiom that I would like to use is this: if (match = my_re1.match(line):

Publish a program

2008-05-21 Thread TheSaint
Hello, I'm not a master of python :) If I would publish my program for reviewing, where should I upload it? -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python for programming algorithms

2008-05-21 Thread Bruno Desthuilliers
Roel Schroeven a écrit : Wow this resulted in far more reactions than I had expected ... [EMAIL PROTECTED] schreef: On 19 mai, 15:30, Roel Schroeven [EMAIL PROTECTED] wrote: Bruno Desthuilliers schreef: 1/ being interpreted or compiled (for whatever definition of these terms) is not a

Re: Using Python for programming algorithms

2008-05-21 Thread Bruno Desthuilliers
sturlamolden a écrit : On May 19, 10:42 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Well... They do - they are called 'C compilers' !-) As Roel Schroven mentioned - and he is at least partially right on this point - C has been designed to make optimizing C compiler not to hairy to write.

Re: HTMLParser error

2008-05-21 Thread alex23
On May 21, 6:58 pm, [EMAIL PROTECTED] wrote: Its not a variable I set, its one of HTMLParser's inbuilt variables. I am using it with urlopen to get the source of a website and feed it to htmlparser. def parse(self, page): try: self.feed(urlopen('http://' + page).read())

Re: HTMLParser error

2008-05-21 Thread alex23
On May 21, 8:04 pm, alex23 [EMAIL PROTECTED] wrote: Is your Spider class a subclass of HTMLParser? Is it over-riding __init__? If so, is it doing something like: super(Spider, self).__init__() If this is your issue[...] I'm sorry, this really wasn't clear at all. What I meant was that

Re: Using Python for programming algorithms

2008-05-21 Thread Frédéric Degraeve
By the way, is it possible (and easy) to call a C function from a Python program?? Use SWIG. It's easy, smart and beautiful. After that, you can call C/C+ + from a lot of scripting languages such as python, R, etc A lot of open sources projects already use it.

Re: Publish a program

2008-05-21 Thread alex23
On May 21, 7:52 pm, TheSaint [EMAIL PROTECTED] wrote: Hello, I'm not a master of python :) If I would publish my program for reviewing, where should I upload it? For simple look at my code I like http://paste.turbogears.org/ Sample: http://paste.turbogears.org/paste/2697 There's also

Re: Using Python for programming algorithms

2008-05-21 Thread Frédéric Degraeve
I reply to myself! Boost.Python is also very known (but never tested by myself). http://www.boost.org/doc/libs/1_35_0/libs/python/doc/tutorial/doc/html/index.html here the example. I know that it has been made to simplify the CPython's use and this is based on CPython. Frédéric --

Re: C-like assignment expression?

2008-05-21 Thread Ulrich Eckhardt
[EMAIL PROTECTED] wrote: I have an if-elif chain in which I'd like to match a string against several regular expressions. Also I'd like to use the match groups within the respective elif... block. The C-like idiom that I would like to use is this: if (match = my_re1.match(line): # use

Minimal Python installation?

2008-05-21 Thread Thomas Troeger
Hi, I'd like to put the python library and interpreter on a small embedded Linux x86 compatible device where disk space is an issue. I played around with the minimal Python interpreters, but was not entirely happy with them, so my question is, is there an (preferably easy) way to put the

Database Query Contains Old Data

2008-05-21 Thread giraffeboy
Hi there, I'm having a problem with the Python db api, using MySQL. I've written a program with a GUI using wxPython, the GUI is contained in main.py which imports another module - reports.py. There are several reports that are selected using the gui, and each report is a class in the file

Re: Newbie: Keep TCP socket open

2008-05-21 Thread Alan Wright
Thanks Roy Any ideas how to code this child process stuff, as I said I am newbie and not from a coding background to be honest ideally yes, i'd get 50K, but if i can get above 30K that would be OK Alan Roy Smith [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] In article [EMAIL

Re: Newbie: Keep TCP socket open

2008-05-21 Thread Alan Wright
Same on FC8, sends RST after it sees SYN/ACK Ghirai [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Mon, 19 May 2008 23:50:50 +0100 Alan Wright [EMAIL PROTECTED] wrote: Ghirai, Scapy does the same, only it sends RST and not FIN, so still no help

Re: getting dir(x), but not as list of strings?

2008-05-21 Thread akeppke
Use for i in dir(x): print i# name of member as string print getattr(x, i)# member regards Arno On 21 Mai, 09:54, [EMAIL PROTECTED] wrote: I want to iterate over members of a module, something like: for i in dir(x): if type(i) ==

Re: Organizing a Python project

2008-05-21 Thread Casey McGinty
I'm starting work on what is going to become a fairly substantial Python project, and I'm trying to find the best way to organize everything. I'd like to add a follow up question. Are there any idioms for writing /usr/bin scripts to run installed package modules? For this I am assuming a

Re: indexed properties...

2008-05-21 Thread pataphor
On Tue, 20 May 2008 10:40:17 -0500 David C. Ullrich [EMAIL PROTECTED] wrote: Today's little joke: Long ago I would have solved this by storing the data as a list of rows and _also_ a list of columns, updating each one any time the other changed. Just goes to show you things could

Re: C-like assignment expression?

2008-05-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Hello, I have an if-elif chain in which I'd like to match a string against several regular expressions. Also I'd like to use the match groups within the respective elif... block. The C-like idiom that I would like to use is this: if (match = my_re1.match(line): #

Re: Code/test ratio wrt static vs dynamic typing

2008-05-21 Thread Bruno Desthuilliers
Ben Finney a écrit : greg [EMAIL PROTECTED] writes: Also, I don't think it's valid to equate the size of the tests with the amount of effort it took to develop them. For instance, the test suite for Pyrex is currently larger than the Pyrex compiler, but I've still spent far more time and

Re: Showing the method's class in expection's traceback

2008-05-21 Thread Bruno Desthuilliers
Gabriel Genellina a écrit : En Sun, 18 May 2008 17:31:44 -0300, Diez B. Roggisch [EMAIL PROTECTED] escribió: Agustin Villena schrieb: is there anyway to show the class of a method in an exception's traceback? I want to improve the line File G:\dev\exceptions\sample.py, line 3, in foo to

Re: Showing the method's class in expection's traceback

2008-05-21 Thread Richard G Riley
Bruno Desthuilliers [EMAIL PROTECTED] writes: Gabriel Genellina a écrit : En Sun, 18 May 2008 17:31:44 -0300, Diez B. Roggisch [EMAIL PROTECTED] escribió: Agustin Villena schrieb: is there anyway to show the class of a method in an exception's traceback? I want to improve the line File

Re: Minimal Python installation?

2008-05-21 Thread Paul Boddie
On 21 Mai, 12:07, Thomas Troeger [EMAIL PROTECTED] wrote: I'd like to put the python library and interpreter on a small embedded Linux x86 compatible device where disk space is an issue. I played around with the minimal Python interpreters, but was not entirely happy with them, so my question

Re: Misuse of list comprehensions?

2008-05-21 Thread Bruno Desthuilliers
Simon Forman a écrit : On May 20, 8:58 am, Paul McGuire [EMAIL PROTECTED] wrote: On May 20, 10:50 am, [EMAIL PROTECTED] wrote: You don't need all those conditionals. A set differs from a list precisely in the fact that each element is unique. And since the function is expecting s to be an

problem with import / namespace

2008-05-21 Thread ohad frand
Hi I have a problem that the solution to it must be very simple but i couldnt fint it's answer in the internet so far (i searched for couple of days) the problme is as follows: i have two directories e.g. \\1 and \\2 in each directory i have two files with the same names e.g. tmp1.py and tmp2.py

Re: How to transfer files over serial?

2008-05-21 Thread zerge69
On May 21, 4:07 am, RaymondHe [EMAIL PROTECTED] wrote: I want to transfer files over serial,but PySerial Module does not support any protocol such as xmodem/ymodem,and I find nothing about these protocol write in python What should I do?Thank you Does it have to be over the serial? If not,

Re: C-like assignment expression?

2008-05-21 Thread Hrvoje Niksic
Bruno Desthuilliers [EMAIL PROTECTED] writes: The canonical solution is to iterate over a list of expression,function pairs, ie: Although that solution is pretty, it is not the canonical solution because it doesn't cover the important case of if bodies needing to access common variables in the

Re: Newbie: Keep TCP socket open

2008-05-21 Thread Roy Smith
In article [EMAIL PROTECTED], Alan Wright [EMAIL PROTECTED] wrote: Thanks Roy Any ideas how to code this child process stuff, as I said I am newbie and not from a coding background The easiest thing would be to use os.system(). If you wanted to spawn 10 child processes, you could do:

qrcode in python?

2008-05-21 Thread Michel Albert
I am planning to write a python-module for python as I haven't found anything on the tubes so far. If anyone has any interesting insight on this topic, replies are welcome! ;) Q: What is QR-Code? A: http://www.denso-wave.com/qrcode/qrstandard-e.html So far (as of May 21st 2008): Google (1

Re: Struct usage and varying sizes of h, l, etc

2008-05-21 Thread Matthieu Brucher
This is all true if you want to operate in native mode; however in standard mode the sizes are fixed -- otherwise there'd be no easy way of reading/writing the fixed-size fields in many common file formats. As the manual says: Native size and alignment are determined using the C

about python modules

2008-05-21 Thread srinivas
hi friends i am new to python programming. i am using Python 2.5 and IDLE as editor. i have developed some functions in python those will be calling frequently in my main method . now i want to know how to import my functions folder to python in sucha way that the functions in functions folder

Re: Running commands on cisco routers using python

2008-05-21 Thread James Harris
On 19 May, 16:18, SPJ [EMAIL PROTECTED] wrote: Is it possible to run specific commands on cisco router using Python? I have to run command show access-list on few hundred cisco routers and get the dump into a file. Please let me know if it is feasible and the best way to achieve this. Can

Re: about python modules

2008-05-21 Thread Roy Smith
In article [EMAIL PROTECTED], srinivas [EMAIL PROTECTED] wrote: hi friends i am new to python programming. i am using Python 2.5 and IDLE as editor. i have developed some functions in python those will be calling frequently in my main method . now i want to know how to import my functions

Re: Misuse of list comprehensions?

2008-05-21 Thread cokofreedom
''.join(seen.add(c) or c for c in s if c not in seen) From what I can understand... .join will be a String of unique 'c' values. 'seen.add(c) or c' will always point to the second statement 'c' because seen.add(c) returns None. 'if c not in seen' will ensure 'c' being added to both the .join

Re: about python modules

2008-05-21 Thread bockman
On 21 Mag, 14:31, srinivas [EMAIL PROTECTED] wrote: hi friends i am new to python programming. i am using Python 2.5 and IDLE as editor. i have developed some functions in python those will be calling frequently in my main method . now i want to know how to import my functions folder to

Re: Database Query Contains Old Data

2008-05-21 Thread Jerry Hill
On Wed, May 21, 2008 at 6:30 AM, [EMAIL PROTECTED] wrote: The first time you run a report, everything works as expected but if you run it a second time, after modifying data, it seems that the data from before the modification is selected on the second report run. Did you remember to commit

Re: C-like assignment expression?

2008-05-21 Thread [EMAIL PROTECTED]
On May 21, 1:47 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote: Although that solution is pretty, it is not the canonical solution because it doesn't cover the important case of if bodies needing to access common variables in the enclosing scope. (This will be easier in Python 3 with 'nonlocal',

Re: Database Query Contains Old Data

2008-05-21 Thread giraffeboy
On May 21, 1:49 pm, Jerry Hill [EMAIL PROTECTED] wrote: Did you remember to commit your changes before re-running the report? Python's DB API requires that any auto-commit feature of the underlying database be turned off by default, so you are required to commit changes yourself. If you're

Re: Print HTML from Python

2008-05-21 Thread Mike Driscoll
On May 21, 3:45 am, Jorgen Bodde [EMAIL PROTECTED] wrote: Hi All, I am at a loss. This is slightly OT because it concerns Windows and HTML printing. I would like to print a HTML document from Python, but not showing the printing dialog. After numerous searches and trials I came to the

Re: C-like assignment expression?

2008-05-21 Thread cokofreedom
On May 21, 3:12 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On May 21, 1:47 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote: Although that solution is pretty, it is not the canonical solution because it doesn't cover the important case of if bodies needing to access common variables in the

Re: Publish a program

2008-05-21 Thread TheSaint
On 18:15, mercoledì 21 maggio 2008 alex23 wrote: On May 21, 7:52 pm, TheSaint [EMAIL PROTECTED] wrote: There's also http://python.pastebin.com, which lets you create a new paste by modifying an existing one, and keeps them linked for easy diff'ing. Sample:

Re: C-like assignment expression?

2008-05-21 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: On May 21, 1:47 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote: Although that solution is pretty, it is not the canonical solution because it doesn't cover the important case of if bodies needing to access common variables in the enclosing scope. (This will be easier

Re: C-like assignment expression?

2008-05-21 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: On May 21, 3:12 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On May 21, 1:47 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote: Although that solution is pretty, it is not the canonical solution because it doesn't cover the important case of if bodies needing to

Re: C-like assignment expression?

2008-05-21 Thread cokofreedom
And wastes time. regular expressions can become expensive to match - doing it twice might be hurtful. Diez match = (my_re1.match(line) or my_re2.match(line)) or my_re3.match(line) ? -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with import / namespace

2008-05-21 Thread Laszlo Nagy
ohad frand wrote: Hi I have a problem that the solution to it must be very simple but i couldnt fint it's answer in the internet so far (i searched for couple of days) the problme is as follows: i have two directories e.g. \\1 and \\2 in each directory i have two files with the same names

Re: Struct usage and varying sizes of h, l, etc

2008-05-21 Thread Grant Edwards
On 2008-05-20, Robert Kern [EMAIL PROTECTED] wrote: I'm looking at the struct module for binary packing of ints and floats. The documentation refers to C datatypes. It's been many years since I looked at C, but I seem to remember that the data type sizes were not fixed -- for example, an

Re: C-like assignment expression?

2008-05-21 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: And wastes time. regular expressions can become expensive to match - doing it twice might be hurtful. Diez match = (my_re1.match(line) or my_re2.match(line)) or my_re3.match(line) How do you know *which* of the three has matched then? Diez --

Re: Showing the method's class in expection's traceback

2008-05-21 Thread Bruno Desthuilliers
Richard G Riley a écrit : Bruno Desthuilliers [EMAIL PROTECTED] writes: (snip) And not that useful - why would one care about the function being defined in class X or Y when one have the exact file and line ? Very obvious I would think. One can develop ones own interactive class browser

Re: Database Query Contains Old Data

2008-05-21 Thread Paul Boddie
On 21 Mai, 15:22, [EMAIL PROTECTED] wrote: I did and I confirmed this by modifying the data, selecting it from the mysql command line client to verify the changes, then running the report again. If I exit the application and then start it again, everything works as expected until the second

Code For Five Threads To Process Multiple Files?

2008-05-21 Thread tdahsu
All, I'd appreciate any help. I've got a list of files in a directory, and I'd like to iterate through that list and process each one. Rather than do that serially, I was thinking I should start five threads and process five files at a time. Is this a good idea? I picked the number five at

how to proccess the blank in the path on linux

2008-05-21 Thread zhf
I want ro walk a directory and its sub directory on linux, to find some shell script file, and run them, but I found some path belong blank charactor, such as '8000 dir', if I write as follow, I got error no such file path = '8000 dir' for root, dirs, files in os.walk(path): cmd = ' ' cmd = 'cd '

Re: Showing the method's class in expection's traceback

2008-05-21 Thread Richard G Riley
Bruno Desthuilliers [EMAIL PROTECTED] writes: Richard G Riley a écrit : Bruno Desthuilliers [EMAIL PROTECTED] writes: (snip) And not that useful - why would one care about the function being defined in class X or Y when one have the exact file and line ? Very obvious I would think. One

Re: C-like assignment expression?

2008-05-21 Thread cokofreedom
On May 21, 4:09 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: And wastes time. regular expressions can become expensive to match - doing it twice might be hurtful. Diez match = (my_re1.match(line) or my_re2.match(line)) or my_re3.match(line) How do you know

Re: problem with import / namespace

2008-05-21 Thread Laszlo Nagy
When you try to import a module, python starts to search for it. The was it does the search is very well defined. It mostly depends on the current directory and sys.path. You can read more about this here: The was it - The way it - inside your app.py file either make sure that the current

Re: Showing the method's class in expection's traceback

2008-05-21 Thread Bruno Desthuilliers
Richard G Riley a écrit : Bruno Desthuilliers [EMAIL PROTECTED] writes: Richard G Riley a écrit : Bruno Desthuilliers [EMAIL PROTECTED] writes: (snip) And not that useful - why would one care about the function being defined in class X or Y when one have the exact file and line ? Very

Re: problem with import / namespace

2008-05-21 Thread ohad frand
Hi Thanks for the answer. I probably didnt write the problem accurately but it is not as you described. (i already read before the section that you pointed and it didnt help me) the problem is that i dont want to import a file from different directory but only from the same directory. \\1\tmp2.py

Re: about python modules

2008-05-21 Thread inhahe
i always just put most of my python files in the c:\python25 directory. including ones i want to import as modules, since they import from there. otherwise you can put the file in c:\python25\lib\site-packages srinivas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi friends i am

Re: Python and Flaming Thunder

2008-05-21 Thread Dave Parker
Personally (and borrowing from Python), I'd prefer something more like: Write Fa. Repeat 8 times: Write -la. I actually kind of prefer that, too. Or Repeat 8 times write -la. I'll think about it. Thank you for suggesting it. On May 20, 3:40 pm, MRAB [EMAIL PROTECTED] wrote: On May

Re: C-like assignment expression?

2008-05-21 Thread inhahe
one of the few things i miss from C is being able to use assignment in expressions. that's the only thing, really. also there's no switch/case, you have to use a dictionary of functions instead, although i rarely need that, usually i just use elif. [EMAIL PROTECTED] wrote in message

Re: how to proccess the blank in the path on linux

2008-05-21 Thread A.T.Hofkamp
On 2008-05-21, zhf [EMAIL PROTECTED] wrote: I want ro walk a directory and its sub directory on linux, to find some shell script file, and run them, but I found some path belong blank charactor, such as '8000 dir', if I write as follow, I got error no such file path = '8000 dir' for root,

Re: C-like assignment expression?

2008-05-21 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: On May 21, 4:09 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: And wastes time. regular expressions can become expensive to match - doing it twice might be hurtful. Diez match = (my_re1.match(line) or my_re2.match(line)) or

Re: how to proccess the blank in the path on linux

2008-05-21 Thread Jeremy Sanders
A.T.Hofkamp wrote: Escape the space to prevent the shell from interpreting it as a word seperator. This of course also holds for all other shell meta characters, such as * [ ] \and a few others I probably have forgotten. If the command was useful (unlike cd), it might be better to use

Re: Code For Five Threads To Process Multiple Files?

2008-05-21 Thread A.T.Hofkamp
On 2008-05-21, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'd appreciate any help. I've got a list of files in a directory, and I'd like to iterate through that list and process each one. Rather than do that serially, I was thinking I should start five threads and process five files at a

Re: Python and Flaming Thunder

2008-05-21 Thread Dave Parker
Or just: If command is quit ... Hmmm. In Flaming Thunder, I'm using is (and is an, is a, etc) for assigning and checking types. For example, to read data from a file and check for errors: Read data from input.txt. If data is an error then go to ... Or when assigning a type to an

Re: compressing short strings?

2008-05-21 Thread inhahe
i don't see anybody mentioning huffman encoding. i think it just works per byte, so it's not as tight as gzip or whatever. but it sounds like it would be easy to implement and wouldn't require any corpus-wide compression information. except a character frequency count if you wanted to be

Re: C-like assignment expression?

2008-05-21 Thread cokofreedom
On May 21, 4:57 pm, inhahe [EMAIL PROTECTED] wrote: one of the few things i miss from C is being able to use assignment in expressions. that's the only thing, really. also there's no switch/case, you have to use a dictionary of functions instead, although i rarely need that, usually i just

Re: Python and Flaming Thunder

2008-05-21 Thread Bruno Desthuilliers
Dave Parker a écrit : Or just: If command is quit ... Hmmm. In Flaming Thunder, I'm using is (and is an, is a, etc) for assigning and checking types. For example, to read data from a file and check for errors: Read data from input.txt. If data is an error then go to ... Arf ! A

Re: C-like assignment expression?

2008-05-21 Thread Paul McGuire
On May 21, 9:09 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: And wastes time. regular expressions can become expensive to match - doing it twice might be hurtful. Diez match = (my_re1.match(line) or my_re2.match(line)) or my_re3.match(line) How do you know

Re: Python and Flaming Thunder

2008-05-21 Thread Dave Parker
On May 20, 7:05 pm, Collin [EMAIL PROTECTED] wrote: Personally, FT is a bit meh to me. The way you issue your statements I always think something is wrong, mainly because when I want to define, say, x, in python I'd go: x = whatever Instantly noting that I defined x. While in Flaming

  1   2   3   >