Hello folks,
I already found some answers on the net, which said that the Tk library
that Tkinter wraps does not offer functionality to minimize an
application to the system tray.
But I hope there are some wizards in here that might tell me that how
it (possibly) could be done.
Thomas
--
Hello,
I have a cgi script that handles fileuploads from windows and *nix
machines. i need os.path.basename(filename) to get the pure filename.
For *nix, thats not a problem, but for windows, it always returns the
full path:
#/usr/bin/env python
import cgi, os
import cgitb; cgitb.enable()
Steve Holden schrieb:
Clearly if form['uploadfile'] is returning the client's path information
you do have to remove that somehow before further processing, which also
means you need to deduce what the client architecture is to correctly
remove path data. Of course this also leaves open the
Bruno Desthuilliers schrieb:
Let me guess : your cgi script is running on *n*x ?-)
Pretty hard to get this one, heh? :-D
Probably.
Good that you decided I was worth the information.
fnames = C:\\dir\\data.ext, /dir/data.txt, dir:data
import ntpath, posixpath, macpath
def
rishi pathak schrieb:
I am not much of a kernel programmer , I have a requirement to shift a
python code to work as a kernel module.
So I was just wondering whether we can write a kernel module in python.
A thought is that if we can somehow convert python code into a C object
code then it can
Hello folks,
I am currently developing an open source Event Managment software
(events in real-life, like concerts, exhibitions etc. :-) ) using wx for
the GUI, and I need an Object database. Since this is the first time I
actually need doing this, I wondered if anybody here could recommend
Simon Brunning schrieb:
On 12 Jan 2007 15:55:39 GMT, Nick Maclaren [EMAIL PROTECTED] wrote:
In article [EMAIL PROTECTED],
Carsten Haese [EMAIL PROTECTED] writes:
| but there are more use
| cases for Decimal than for Rational.
That is dubious, but let's not start that one again.
Decimals
Laszlo Nagy schrieb:
Thomas Ploch írta:
Hi folks,
I have a data structure that looks like this:
d = {
'url1': {
'emails': ['a', 'b', 'c',...],
'matches': ['d', 'e', 'f',...]
},
'url2': {...
}
This dictionary will get _very_ big, so I want to write
Thomas Ploch schrieb:
Laszlo Nagy schrieb:
Thomas Ploch írta:
Hi folks,
I have a data structure that looks like this:
d = {
'url1': {
'emails': ['a', 'b', 'c',...],
'matches': ['d', 'e', 'f',...]
},
'url2': {...
}
This dictionary will get _very_ big, so I
Hello fellows,
I just wanted to know, if there is any best practice concerning
following code:
import re, shelve
class TextMatcher:
def __init__(self, patterns, email=False, dbName='textmatch.db'):
self._initPatterns(patterns)
self.email = email
self.dbName = dbName
Thomas Ploch schrieb:
Hello fellows,
I just wanted to know, if there is any best practice concerning
following code:
import re, shelve
class TextMatcher:
def __init__(self, patterns, email=False, dbName='textmatch.db'):
self._initPatterns(patterns)
self.email
Hi folks,
I have a data structure that looks like this:
d = {
'url1': {
'emails': ['a', 'b', 'c',...],
'matches': ['d', 'e', 'f',...]
},
'url2': {...
}
This dictionary will get _very_ big, so I want to write it somehow to a
file after it
belinda thom schrieb:
Hello,
In what version of python were private variables added?
Thanks,
--b
With this question you stepped into a bee hive. :-)
Read the 'Why less emphasis on private data?' thread.
But I can't tell you, when this so called 'private variables' were added.
Ravi Teja schrieb:
Thomas Ploch wrote:
Hi folks,
I have a data structure that looks like this:
d = {
'url1': {
'emails': ['a', 'b', 'c',...],
'matches': ['d', 'e', 'f',...]
},
'url2': {...
}
This dictionary will get _very_ big, so I want
Ravi Teja schrieb:
Thomas Ploch wrote:
Ravi Teja schrieb:
Thomas Ploch wrote:
Hi folks,
I have a data structure that looks like this:
d = {
'url1': {
'emails': ['a', 'b', 'c',...],
'matches': ['d', 'e', 'f',...]
},
'url2': {...
}
This dictionary
[EMAIL PROTECTED] schrieb:
Hi,
I have been programming in the .net environment and ide for a few
years and I am looking to make the switch over to python. I have
absolutely no python experience whatsoever. I am looking for a python
guru who has instant messenger or gtalk or whatever who can
Jorgen Grahn schrieb:
On 06 Jan 2007 17:38:06 -0800, Paul Rubin http wrote:
BJörn Lindqvist [EMAIL PROTECTED] writes:
It is given that emphasizing private data (encapsulation) leads to
more internal complexity and more lines of code because you have to
write getters and setters and stuff.
Paul Rubin schrieb:
Thomas Ploch [EMAIL PROTECTED] writes:
Me neither, although I have to say that the '__' prefix comes pretty
close to being 'private' already. It depends on the definition of
private. For me, private means 'not accessible from outside the
module/class'.
class
W. Watson schrieb:
As I understand it, there are two files I'm after: 1. python interpreter,
and 2. a python editor. It's #2 that I'm having trouble downloading. The
link is broken.
This is the python interpreter for windows:
http://www.python.org/ftp/python/2.5/python-2.5.msi
Here you
sturlamolden schrieb:
[EMAIL PROTECTED] wrote:
Coming from a C++ / C# background, the lack of emphasis on private data
seems weird to me. I've often found wrapping private data useful to
prevent bugs and enforce error checking..
It appears to me (perhaps wrongly) that Python prefers to leave
Sebastian 'lunar' Wiesner schrieb:
Those people deserve to fail for being just extraordinary stupid...
Yes, but there are a lot of them around...
Thomas
P.S.: I don't mean they are around here. :-)
--
http://mail.python.org/mailman/listinfo/python-list
Florian Diesch schrieb:
Michael M. [EMAIL PROTECTED] wrote:
In Perl, it was:
## Example: Abc | def | ghi | jkl
## - Abc ghi jkl
## Take only the text betewwn the 2nd pipe (=cut the text in the 1st
pipe).
$na =~ s/\ \|(.*?)\ \|(.*?)\ \|/$2/g;
## -- remove [ and ] in
Michael M. schrieb:
How to find the longst element list of lists?
I think, there should be an easier way then this:
s1 = [q, e, d]
s2 = [a, b]
s3 = [a, b, c, d]
if len(s1) = len(s2) and len(s1) = len(s3):
sx1=s1 ## s1 ist längster
if len(s2) = len(s3):
Michael M. schrieb:
Err... this makes three distinct lists, not a list of lists.
Sure. Logically spoken. Not in Python code. Or a number of lists.
Sure not [[ bla... ] [bla.]] etc.
???
Thomas
--
http://mail.python.org/mailman/listinfo/python-list
W. Watson schrieb:
The wiki site lead to a link to download pythonwin, but the download is
broken. Googling invariably leads back to that link. I found
http://www.python.org/download/releases/binaries-1.4/pythonwin/, which has
two files listed: oadist.exe and win32dbg.exe. Do I need both or
Beliavsky schrieb:
If the C or Fortran committees tried to change
the meaning of int/int, they would be shot.
Or hanged...
If you want to be confident that your code will run, unchanged, 10
years from now on the hardware and OS that will then be common, Python
2.x is not the language to
[EMAIL PROTECTED] schrieb:
Coming from a C++ / C# background, the lack of emphasis on private data
seems weird to me. I've often found wrapping private data useful to
prevent bugs and enforce error checking..
It appears to me (perhaps wrongly) that Python prefers to leave class
data public.
Grant Edwards schrieb:
On 2007-01-05, king kikapu [EMAIL PROTECTED] wrote:
Python code is normally deployed as straight source code.
But isn't this a problem of its own? I mean, many people do not feel
good if the know that their source code is lying around on other
machines...
Are they
[EMAIL PROTECTED] schrieb:
I'm still pretty new to Python. I'm writing a function that accepts
thre integers as arguments. I need to divide the first integer by te
second integer, and get a float as a result. I don't want the caller of
the function to have to pass floats instead of integers.
Jonathan Smith schrieb:
Thomas Ploch wrote:
[EMAIL PROTECTED] schrieb:
I'm still pretty new to Python. I'm writing a function that accepts
thre integers as arguments. I need to divide the first integer by te
second integer, and get a float as a result. I don't want the caller of
the function
Grant Edwards schrieb:
On 2007-01-05, Jonathan Smith [EMAIL PROTECTED] wrote:
from __future__ import division
1/2
0.5
$ python
Python 2.4.3 (#1, Dec 10 2006, 22:09:09)
[GCC 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)] on linux2
Type help, copyright, credits or
goodepic schrieb:
I successfully installed postgresql and pygresql from source on my
MacBook 2ghz Intel core duo running os x 10.4.8. However, pygresql
installed under the defualt python 2.3 installation, while I've been
upgrading and working in 2.5, and have invested too much time to go
Hello folks,
I am having troubles with implementing a timed queue. I am using the
'Queue' module to manage several queues. But I want a timed access, i.e.
only 2 fetches per second max. I am horribly stuck on even how I
actually could write it. Has somebody done that before? And when yes,
how is
jeremito schrieb:
I am writing a class that is intended to be subclassed. What is the
proper way to indicate that a sub class must override a method?
Thanks,
Jeremy
What do you mean by 'indicate'? Writing it to the docstring of the
class/method? Writing a comment?
class Foo:
Gabriel Genellina schrieb:
At Thursday 4/1/2007 23:52, jeremito wrote:
I am writing a class that is intended to be subclassed. What is the
proper way to indicate that a sub class must override a method?
If any subclass *must* override a method, raise NotImplementedError in
the base class
Grant Edwards schrieb:
On 2007-01-05, Thomas Ploch [EMAIL PROTECTED] wrote:
I am writing a class that is intended to be subclassed. What
is the proper way to indicate that a sub class must override a
method?
If any subclass *must* override a method, raise
NotImplementedError in the base
Matimus schrieb:
I don't know of a converter, one may exist. I have seen similar
requests though and will give you a similar response to what I have
seen. A converter, if it exists, may be able to produce working code
but _not_ readable code. Python is a language whose strength comes
from,
meelab schrieb:
Dear All,
I am looking for a way to create a static object or a static class -
terms might be inappropriate - having for instance:
class StaticClass:
.
.
and then
staticObject1 = StaticClass()
staticObject2 = StaticClass()
so that staticObject1 and
Marc 'BlackJack' Rintsch schrieb:
In [EMAIL PROTECTED], Thomas Ploch
wrote:
Alright, my prof said '... to process documents written in structural
markup languages using regular expressions is a no-no.' (Because of
nested Elements? Can't remember) So I think he wants us to use regexes
Marc 'BlackJack' Rintsch schrieb:
In [EMAIL PROTECTED], Thomas Ploch
wrote:
This is how my regexes look like:
import re
class Tags:
def __init__(self, sourceText):
self.source = sourceText
self.curPos = 0
self.namePattern = [A-Za-z_][A-Za-z0-9_
John Nagle schrieb:
Very true. HTML is LALR(0), that is, you can parse it without
looking ahead. Parsers for LALR(0) languages are easy, and
work by repeatedly getting the next character and using that to
drive a single state machine. The first character-level parser
yields tokens,
Hello fellow pythonists,
I have a question concerning posting code on this list.
I want to post source code of a module, which is a homework for
university (yes yes, I know, please read on...).
It is a web crawler (which I will *never* let out into the wide world)
which uses regular expressions
Steven D'Aprano wrote:
On Sun, 31 Dec 2006 02:03:34 +0100, Thomas Ploch wrote:
Hello fellow pythonists,
I have a question concerning posting code on this list.
I want to post source code of a module, which is a homework for
university (yes yes, I know, please read on...).
So long
I wish everybody a merry Christmas and a happy new year.
Have a good and beautiful new year.
Thomas
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
Nick Craig-Wood wrote:
A regular expression matcher uses a state machine to match strings.
unless it's the kind of regular expression matcher that doesn't use a
state machine, like the one in Python.
/F
How is the matching engine implemented then?
I thought
Delaney, Timothy (Tim) wrote:
Hendrik van Rooyen wrote:
naaah - you don't have to worry - for real control He uses assembler.
with jump statements.
so the loops are closed.
Unfortunately its not open source. Yet.
People are working hard on reverse-engineering it though. I hope no one
Ben Finney schrieb:
John Machin [EMAIL PROTECTED] writes:
Ben Finney wrote:
\ ...one of the main causes of the fall of the Roman Empire was |
`\that, lacking zero, they had no way to indicate successful |
_o__) termination of their C programs. -- Robert Firth
Mark Schoonover schrieb:
You have to pay for this one, but I do like Komodo just for the regex
feature. I'm rather new to Python, coming over from 10 years of Perl, and
it's nice to have Komodo stay consistant. Can't wait for 4.0, so I can get
back to having VI key commands Back into
Ben Finney schrieb:
John Machin [EMAIL PROTECTED] writes:
Ben Finney wrote:
\ ...one of the main causes of the fall of the Roman Empire was |
`\that, lacking zero, they had no way to indicate successful |
_o__) termination of their C programs. -- Robert Firth
Felix Benner schrieb:
Thomas Ploch schrieb:
Ben Finney schrieb:
John Machin [EMAIL PROTECTED] writes:
Ben Finney wrote:
\ ...one of the main causes of the fall of the Roman Empire was |
`\that, lacking zero, they had no way to indicate successful |
_o__
Martin P. Hellwig schrieb:
Quite punny title though I assume you are really serious and mean people
with a physical disability, I won't comment any further on this subject
:-), if I already offended anyone, please excuse me, since I'm original
from Germany I'm not supposed to be funny.
[EMAIL PROTECTED] schrieb:
Hi
Does any one know of any good folder/directory modules. I need to be
able to see what files and directories are in a folder, I also need to
be able to see the size of the directory content.
Thanks
You should have a look here:
Asper Faner schrieb:
I seem to always have hard time understaing how this regular expression
works, especially how on earth do people bring it up as part of
computer programming language. Natural language processing seems not
enough to explain by the way. Why no eliminate it ?
Erm, I am a
Roy Smith schrieb:
In article [EMAIL PROTECTED],
Jeff Rush [EMAIL PROTECTED] wrote:
As the Python Advocacy Coordinator, I've put up some wiki pages on the
Python
website for which I'm soliciting ideas, writing and graphics. Some of the
material exists scattered about and just needs
Thomas Ploch schrieb:
Roy Smith schrieb:
In article [EMAIL PROTECTED],
Jeff Rush [EMAIL PROTECTED] wrote:
As the Python Advocacy Coordinator, I've put up some wiki pages on the
Python
website for which I'm soliciting ideas, writing and graphics. Some of the
material exists scattered
Hello,
for me the 80 (or 79) char border when writing code is a fundamental
rule. Being at University and having to document each project on paper,
it is a must do. i.e. I get code from fellow scolars, that have 160
chars per line, and to get that on paper is disgusting, especially in
C/C++. So
stdazi wrote:
Usually, when I make some coding mistake (index out of range - in this
case) I just care to fix the mistake and I usually don't mind to
inspect by how much the index was overflowed. It really seems like a
feature that should be embedded in some Python debugger than a feature
in
Thomas Ploch schrieb:
Amir Michail schrieb:
Hi,
It seems to me that measuring productivity in a programming language
must take into account available tools and libraries.
Eclipse for example provides such an amazing IDE for java that it is no
longer obvious to me that one would be much
Amir Michail schrieb:
krishnakant Mane wrote:
just used the py dev plugin for eclipse.
it is great.
But isn't support for java better because the eclipse ide can take
advantage of explicit type declarations (e.g., for intellisense,
refactoring, etc.)?
Amir
Obviously, since eclipse
SPE - Stani's Python Editor schrieb:
On 30 nov, 10:50, egbert [EMAIL PROTECTED] wrote:
On Wed, Nov 29, 2006 at 03:15:45PM -0800, SPE - Stani's Python Editor
wrote: Do you have python-wxversion installed?
$sudo apt-get install python-wxversionThat helped. But why isn't it
included in the
Nick schrieb:
http://www.sciencedaily.com/releases/2006/11/061130081347.htm
World's Oldest Ritual Discovered -- Worshipped The Python 70,000 Years
Ago
Nick
That's really interesting since there is an indio tribe in the amazonas
jungle which also worships python.
That just tells me
Markus Rosenstihl schrieb:
On 2006-11-19 15:50:14 +0100, Thomas Ploch [EMAIL PROTECTED] said:
Hello,
I followed the instructions in the Mac/README file.
I ran ./configure --enable-framework
But when I try to build from source with gcc 4.0.2, following happens:
[snip]
libtool: can't
Gheorghe Postelnicu schrieb:
Hi,
I have a situation of the following type:
for line in lineList:
for item in line.split()
myArray[counter, itemCounter]
itemCounter = itemCounter + 1
counter = counter +1
Is there a way to get rid of the manual incrementation of
John Henry schrieb:
If I have a list of say, 10 elements and I need to slice it into
irregular size list, I would have to create a bunch of temporary
variables and then regroup them afterwords, like:
# Just for illustration. Alist can be any existing 10 element list
a_list=(,)*10
John Henry schrieb:
If I have a list of say, 10 elements and I need to slice it into
irregular size list, I would have to create a bunch of temporary
variables and then regroup them afterwords, like:
# Just for illustration. Alist can be any existing 10 element list
a_list=(,)*10
John Henry schrieb:
Thomas Ploch wrote:
snip
I had a little bit of fun while writing this:
itemList = (a,b,c1,c2,c3,d1,d2,d3,d4,d5) and
itemList2 = (a1,a2,a3,b,c,d1,d2,d3,d4,d5) the next time.
Huh? What's a,b,d5?
John Henry schrieb:
Thomas Ploch wrote:
snip
I had a little
Robert R. schrieb:
Hello,
i would like to write a piece of code to help me to align some sequence
of words and suggest me the ordered common subwords of them
s0 = this is an example of a thing i would like to have.split()
s1 = another example of something else i would like to have.split()
Is it defined behaviour that all files get implicitly closed when not
assigning them?
Like:
def writeFile(fName, foo):
open(fName, 'w').write(process(foo))
compared to:
def writeFile(fName, foo):
fileobj = open(fName, 'w')
fileobj.write(process(foo))
halex2000 schrieb:
Hi all, I'm new with Python, and I thought to use it to automatically rename
some files in a directory, but I don't know where should I search the
functions: to get all the files of a directory, to rename the files and so
on.
Thank you.
Have you actually even tried
os.walk() is a nice generator for performing actions on all files in a
directory and subdirectories. However, how can one use os.walk() for walking
through two hierarchies at once? I want to synchronise two directories (just
backup for now), but cannot see how I can traverse a second one. I
Hello,
I followed the instructions in the Mac/README file.
I ran ./configure --enable-framework
But when I try to build from source with gcc 4.0.2, following happens:
[snip]
libtool: can't locate file for: -lSystemStubs
libtool: file: -lSystemStubs is not an object file (not allowed in a
Hello folks,
I am thinking about reading and understanding the Source Code of Python, but
where would it be best to start? Possibly someone can give me a little hint. I
am getting into socketmodule.c a little bit at the moment, but thats not what I
want.
Greetz, Thomas
--
Der GMX
Hello folks,
Since this is my first post on the list, a brief introduction of myself.
My name is Thomas, I am 26 years old, I am a student of Computational
Linguistics and I am a python user. :-)
Now my problem:
I have Tcl/Tk 8.4.4 installed:
iPimpG4:~ profipimp$ tclsh
% info patchlevel
Kevin Walzer schrieb:
Thomas Ploch wrote:
Hello folks,
Since this is my first post on the list, a brief introduction of myself.
My name is Thomas, I am 26 years old, I am a student of Computational
Linguistics and I am a python user. :-)
Now my problem:
I have Tcl/Tk 8.4.4
74 matches
Mail list logo