the Path variable.
I have no doubt that you're correct. Just confused as usual.
import sys
print sys.path
and see what's there.
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam
injal(weeble)
Not perfect but manageable I think...
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
--
http://mail.python.org/ma
Preference=50, Mail Exchange=gsmtp163.google.com
Preference=50, Mail Exchange=gsmtp183.google.com
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - htt
or-oriented operations the NumArray package is well suited.
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
--
http://mail.python.org/mailman/listinfo/python-list
. The *from* email address is irrelevant and
can even be faked.
Of course a spam filter could block such mails, but you have to test it.
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡g
should be "python_script.py"
You may want to un-select "Hide extensions for known file types" in
Windows Explorer options.
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispa
;enter the Python interpreter" that means "execute
python from the command line", not PythonWin nor IDLE nor...
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
--
http://mail.python.org/mailman/listinfo/python-list
At Thursday 14/12/2006 05:50, avlee wrote:
Is it possible to use in python variables with dynamicly created names ?
How ?
Use a dictionary:
d = {}
d[almost_arbitrary_key] = value
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio
):
return (record.levelno >= self.levelmin and
record.levelno <= self.levelmax)
and add an instance of LevelFilter to each handler. (Untested)
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antiv
= quotes[num]
path = luckyWinner.absolute_url()
return path
Should work, untested...
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
--
http://mail.python.org/mailman/listinfo/python-list
At Thursday 14/12/2006 15:30, Neil Cerutti wrote:
I like using pattern matching in these simple cases:
last_line, _ = subprocess.Popen([r"tail","-n 1", "x.txt"],
stdout=subprocess.PIPE).communicate()
pattern matching???
--
7;b' referenced before assignment
Compare your function with the version shown in the tutorial.
Variable 'b' is assigned on the previous line.
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, anti
more, or so broad to consider all things that os.startfile can handle
without error.
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com
ersed: keep a remotely accesable log of events and let the user
look at it whenever he wants.
- Variant: an RSS feed
- Telegram
- Smoke or dum signals
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivi
s you to do...
There are several implementations, try google...
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
--
http://mail
fundamental unit and even NO fundamental units.
There is a nice book about this subject by L. A. Sena: Units of
physical quantities and their dimensions (or similar, I don't have it
at hand to check the title).
--
Gabriel Genellina
Softla
u can have a non gui
application -an HTTP server by example- using many threads with no problems.
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! -
At Friday 15/12/2006 02:15, Lialie - KingMax wrote:
Please keep your posting on the list.
Gabriel Genellina wrote:
> At Thursday 14/12/2006 23:55, Lialie - KingMax wrote:
>
>> I create a thread in a non gui thread, and it does well. But it seems
>> strange. Somebody told me
write, in ATS.py:
from LevelRegulation import whatever
from CurveDetection.MyModuleName import MyClass
etc.
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta
, 4]))
Be aware that map, filter, and reduce may be dropped in Python 3000.
http://www.artima.com/weblogs/viewpost.jsp?thread=98196
(and I won't miss them if gone)
--
Gabriel Genellina
Sof
slates into a string like '2005-08-03 07:32:48'. No problem
> with that -- all works quite nicely, until you try to put data back the
> other way.
Dont convert to string and keep the datetime object.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
a singleton, compare using "x is None" or "x is not None", dont
use ==
This is more stylish, but I prefer to use isxxx() or hasxxx() for
functions that return booleans.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
rectly accessing the private internals of a class.
In Python, the usual way of saying "don't play with me" is prepending
an underscore: _private
BTW, have you *ever* tested your code?
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
On 15 dic, 13:46, "Will Ware" <[EMAIL PROTECTED]> wrote:
> Gabriel Genellina wrote:
> > In Python, the usual way of saying "don't play with me" is prepending
> > an underscore: _private
> Thanks, I am familiar with that.
So enforce it instead of g
't
provide a callback at all, or it's an empty one, or it contains just
a print ".", statement, all of these returning False; so, to actually
abort the process it must have an explicit "return True" statement).
--
Gabriel Genellina
Softlab SRL
___
, portable or not? Unless the OS
actually tries to load and examine the file contents, which the OS's
I'm aware of, don't do.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
rom the library
would be a good thing.
So, keep your library inside a package, and provide some external
scripts as example, demo, whatever.
You can instruct distutils to install each thing in the right place.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
o
> do more than just storing the value.
You've provided the answer: properties are OK if you need to do "more"
that just store the value. Else, they're a waste of programmer and
processor time.
That was not clear on your original post.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
t.com
Googling with "outlook application python" will give you more help.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
asses:
from inspect import isclass
for obj in globals().values():
if isclass(obj): # may be stricter too, like issubclass(obj, Base)
reg.append(obj)
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
bably the error is inside the C extension, not in Python code.
Contact the author.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
ctually
> a binary executable.
A similar function exists on Linux too. But even if a file has the
right file format, if it does not have the execute bit set, won't run.
And you could set that bit on a JPG image too - and nothing good would
happen, I presume. So one must determine first what means "the file is
executable".
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
ociation defined and run that program if there is.
b) If the file *is* "executable", run it.
This is what os.startfile does. The underlying Win32 functions would
be ShellExecute, FindExecutable & their variants.
Will you maintain your own registr
che server by python code.
give suggestions..
See the httplib module
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.a
At Monday 18/12/2006 12:30, Richard Konrad wrote:
Does anyone know about a python-script to upload Files via http/cgi?
See the urllib2 module.
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y
ght be retrieving another thing...
The *strange* is that I get the same error even if I pass the attribute
name to the getattr() function as pure string:
getattr(container,"WorkFlowTest")
(sic!)
If you're really sure of this, I think the error may occur inside
another funct
ion?)
If you don't catch the exception, an error page will be displayed,
pointing to the error_log object.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber
ocus on the the tasks within our
application the user is authorized to perform"
Search for SSPI. But it may be a bit tricky to get running.
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispa
ry javadoc (the java package), it is easier to use than a
pure reflection approach.
--
Gabriel Genellina
Softlab SRL
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.
x27;t change all days, and being a
python only library, the only changes would be due to compatibility
issues or adopting new language features of new python versions.
BTW, I like HyperText more than htmlgen.
--
Gabriel Genellina
Softla
ut will raise KeyError instead)
A property is more convenient in this case.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Y
exception, full traceback as printed by the interpreter?
- Python version in use?
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo
arameter
(usually called "self") that refers to the instance on which you call
the method (like "this" on other languages, but you have to be explicit
in Python).
Read the Python tutorial: http://docs.python.org/tut/
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
a in d.compare([' a larger line'],['a longer line']): print
delta
-a larger line
? --- ^^
+ a longer line
?^^
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
> > def enlargetable(table,col):
> > return table.append(col)
Google for "python pitfalls"
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
At Thursday 21/12/2006 14:50, Matimus wrote:
The following will do exactly the same thing as
the above:
[code]
def enlargetable(table,col):
table.append(col)
return table
[/code]
Which, by the way, was one of the first answers he got, by Edward Kozlowski.
--
Gabriel Genellina
ses a different
exception now.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yaho
part of the clear message is a security
hole. Using an structured container (like a zip/rar/... file) gets
worse because the fixed (or "guessable") part is longer, but anyway,
2 bytes may be bad enough.
See RFC1950 <ftp://ftp.isi.ed
Fredrik Lundh ha escrito:
> Gabriel Genellina wrote:
>
> > If you want to encrypt a compressed text, you must remove redundant
> > information first.
>
> encryption? didn't the OP say that he *didn't* plan to decompress the
> resulting data stream?
I was
entation may be arcane sometimes, but this is easily
found at http://docs.python.org/dist/node12.html)
Absolute dirs are almost never necesary, usually all distutils commands
operate on relative paths (relative to location of setup.py for source
files, relative to some meaningful directory for targets).
--
Gab
child threads, then do something, then
> when got ^C keyboard exception, stop the child thread.
You've created the threads, you've handled ^C, what's missing...?
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
__init__.py) so from "outside", people can say:
from foo.bar import MyClass
if you consider MyClass being in its own module an implementation
detail that should be hidden.
Module layout is an important design concept
--
Gabriel Genellina
S
the same. That's all - most of the time.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Proba
At Friday 22/12/2006 20:45, Pyenos wrote:
# Error message says: #
# UnboundLocalError: local variable 't_len' referenced before assignment#
See item 6 in "10 Python pitfalls":
<http://zephyrfalcon.org/labs/python_pitf
e not declared it as global inside def METHOD2. so
var within def METHOD2 is a different variable to the global variable var.
Read the Python Pitfalls I've send some minutes ago, and the tutorial
(specially http://docs.python.org/tut/node11.html#scopes) and then
re-answer your own quest
t an implementation detail, and not part of the
package public interfase.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respu
46.198.60', 21))
(2, 1, 0, '', ('207.46.199.30', 21))
(2, 1, 0, '', ('207.46.225.60', 21))
(2, 1, 0, '', ('207.46.19.30', 21))
(2, 1, 0, '', ('207.46.19.60', 21))
(2, 1, 0, '', ('207.46.20.30'
no dupes on the first column) but anyway its a
large number... (Or I'm wrong computing the possibilities...)
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías sab
WM_KEYDOWN/WM_KEYUP.
Or, for a specific key, you can use GetKeyState/GetAsyncKeyState. For
the whole keyboard use GetKeyboardState.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que
ook.exe".
I'm using windows xp.
There is a module named SendKeys which may be useful, try to find it.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y
files, and is relatively slow.
Google "python levenshtein". You'll probably find this a better fit for
typoed keys in a database.
Other alternatives: trigram, n-gram, Jaro's distance. There are some
Python implem. a
ite the text "None" whenever
the field is empty, so you will never get , instead:
None. If you want to get the former, use: if fname is
None: fname = ""
--
Gabriel Genellina
Softlab SRL
__
Pregunt
xcept AttributeError:
doStuff.timesUsed = 1
# ... special case for first call ...
# ...common code...
If you need to code something special for the 2nd and following
calls, add an else: clause
--
Gabriel G
ver'", and uses
stdin and stdout of that process as a communication channel.) There is
no need for interface definitions, no need to open communication
ports, no need to copy remotely run function code to remote hosts.
http://www.cs.tut.fi/~ask/rthread/index.html
--
Gabr
y the other thread. is this possible ?
Put some print statements and see what happens. I'm sure things are a
lot simpler than you think.
You said a module, but now you use MyPackage - how do you assign to
MyPackage.aVariable? inside its __init__.py?
--
Gabriel Genellina
S
libraries -like PIL- require at least 1.5
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya
getattr to see if it raises an
exception (this is documented behavior, not a hidden implementation detail).
In Python it's far more common EAFP ('easier to ask for forgiveness
than permission') than LBYL ('look bef
lbox, and A Digital
Government Web Service (2003)
Mohamed G. Elfeky, Vassilios S. Verykios, Ahmed K. Elmagarmid, Thanaa
M. Ghanem, Ahmed R. Huwait.
http://citeseer.ist.psu.edu/elfeky03record.html
--
Gabriel Genellina
- other classes not derived from Exception: still legal, probablly
not on future Python versions.
If you really have to catch any kind of exception, use a bare except
clause; you always can retrieve the exception details using
sys.exc_info()
--
Gabriel G
del exists
by itself even before you need the view, so usually the view
constructor gets the model as an argument.
I prefer to use lowercase attribute names: self.model = Model(), this
way there is no confusion between model (an instance) and Model (a class).
--
Gabriel Genellina
S
d over tabs.
Of course you can do it anyway you like, but you should have a
*strong* reason for not following a *strong* recommendation.
(Just a note, you can use untabify.py (inside the Tools dir) to
convert tabs to spaces, instead of unexpand)
--
Gabriel Gene
class who's "__call__" method can be
wrapped to do this?
See Stain Soiland's site http://soiland.no/software/decorator for his
logging decorator and logging metaclass.
--
Gabriel Genellina
Softlab SRL
___
u make Python silently ignore the arguments?
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
ht
entation, or
somewhere. Anyway, choose_boundary() should be robust enough to catch
the possible exception and act accordingly, I think.
In the meantime, you may put this near the top of your script:
mimetools._prefix = &quo
&aid=1250170&group_id=5470&atid=105470
Should work on Python 2.4.4 and later.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginab
7;t need a nested class at all.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.ya
but
certainly is *not* a recommended newbie practice.
It's like using the accelerator and brake at the same time when
driving - an experienced driver *might* do that in certain
circunstances, but if you are learning to drive, you either
accelerate or either use the brake but NOT both.
--
ibute of Class1. Putting all this together, you can refer to such
"var" as Class1.Class2.Class3().var
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías
ot;foo.txt", "r"), delimiter='\t')
output = open("bar.txt","wt")
for row in params:
output.write("%s IRM=3PL IPB=%s\n" % (row[0], row[1]))
output.close()
params.close()
--
Gabriel Genellina
Softlab SRL
__
clear:
import sys
class Foo:
def __getattr__(self, attr):
print "About to exit program"
sys.exit(1)
f = Foo()
dir(f)
print "You should not see this line"
--
Gabriel Genellina
Softlab SRL
__
like it's running out of memory and is being
forced to use extended memory, but I do not know enough about the
Only a standard advise: try not to load all the records together,
instead, if possible, process them one record at a time. This way
you're not bound by available memory.
def _parse_ns_name(...):
...doing the right thing...
from xml.dom import modulename
modulename._parse_ns_name = _parse_ns_name
(maybe checking version numbers too)
--
Gabriel Genellina
Softlab SRL
__
At Thursday 28/12/2006 15:39, Scripter47 wrote:
A module that gets
_anything_ what the keyboard writes.
You want a "keylogger"
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí
plications
depending on it, like the bittorrent client.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
At Friday 29/12/2006 01:05, [EMAIL PROTECTED] wrote:
The specified module could not be found.
LoadLibrary(pythondll) failed
For the bittorrent client, reinstalling it should be enough.
For other issues on your system, best to contact your vendor.
--
Gabriel Genellina
Softlab SRL
e in the
class __dict__, where do they live? What other methods and attributes are
invisibly in X?
They live in the C structure implementing the type; members tp_bases
and tp_name respectively. Most predefined type/class attributes have
an slot for storing i
icate(), etc and it is
always the same.
Did you *actually* tried what Tom Plunket posted? Two tiny chars make
a difference.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que qu
path- create a new key below App Paths, named "python.exe", and set
its default value to the full path of the installed python executable.
See
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_extending/fileassociations/fa_perce
ule not defined
Does it work if you try it from the interpreter?
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! R
while ids:
key = ids.pop(0)
tree = tree[key]
return tree
and say: traverse_tree(tree6, 0, 1, 0, 1, 1, 1, 0) or
traverse_tree(tree6, *[0,1,0,1,1,1,0]) or traverse_tree(tree6,
*[0,1,0,1,1])[0] = another_object
--
Gabriel Genellina
Softlab SRL
t the command
line, it fails.
Typing "start firefox" at the command line should work.
It appears that cmd.exe does *not* use ShellExecute to find the
executable, so this approach doesn't work as expected :(
--
Gabriel Genellina
Softlab SRL
in b):
print x,y
Create this list:
[(1,2), (3,4), (5,6)]
b=iter(a)
[(item, b.next()) for item in b]
Note that they don't behave the same at the corner cases (empty list,
single item, odd length...)
--
Gabriel Genellina
S
At Friday 29/12/2006 05:55, Scripter47 wrote:
I need a module called "pythoncom" anyone that knows where a can find
that module???
It's part of the pywin32 package
https://sourceforge.net/project/showfiles.php?group_id=78018
--
Gabriel Genell
not be used (imported) by anyone.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http
default MailMan administrative interfase. Send a
RFE to the MailMan developers.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! R
e isinstance or issubclass instead, they check
for derived classes too. A derived class can (or could) always be
used wherever a base class is suitable.
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Respo
e properties, descriptors, and such, look for
the Singleton (or Borg) pattern in the Python Cookbook:
http://aspn.activestate.com/ASPN/Cookbook/Python/
--
Gabriel Genellina
Softlab SRL
__
Preguntá. Re
as above
pi = pi + str("%04d" % int(e + d/a)) ## this should be fast?! I dont
Someone else already pointed out how to improve this.
You don't show the rest of the code...
--
Gabriel Genellina
Softlab SRL
_
sys.stdout.writelines(pi())
(The converted C code does a lot of nonsense in Python terms - maybe
you should try to interpret *what* it does and then reimplement that
using Python)
--
Gabriel Genellina
Softlab SRL
At Thursday 4/1/2007 10:12, siggi wrote:
Thanks for the explanation. I am astonished what an interpreted language is
able to do!
Python is as interpreted as Java. Its numerical capabilities are more
or less independent of this fact, I'd say.
--
Gabriel Genellina
Softla
601 - 700 of 5091 matches
Mail list logo