Timezone and ISO8601 struggles with datetime and xml.utils.iso8601.parse

2005-09-09 Thread Samuel
ISO-8601 date format: " + `s` ValueError: unknown or illegal ISO-8601 date format: '2005-07-22T10:30:00' -- Why does it fail to parse the value returned by the datetime object, and how can I create a parseable time from the datetime object? Thanks, -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Timezone and ISO8601 struggles with datetime and xml.utils.iso8601.parse

2005-09-09 Thread Samuel
o do this though.) Then, when passing the tz.LocalTimezone instance to datetime, isoformat() returns the string with an offset appended (e.g. +02:00). The resulting string can then also successfully be parsed with xml.utils.iso8601.parse(). Thanks for your help! -Samuel -- http://mail.python.org/

No newline using printf

2005-09-15 Thread Samuel
ement only substitutes the newline for a space, which is not what I am looking for. Any hints? Thanks, -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: No newline using printf

2005-09-16 Thread Samuel
Thanks for your help, Guys. This works of course. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Creating database structures in a portable way

2006-09-18 Thread Samuel
com/lens/adodb/docs-datadict.htm#xmlschema Is there a way to do something similar with the DB-API modules in Python? Thanks, -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating database structures in a portable way

2006-09-18 Thread Samuel
t's only the installation part. Anyway, I am wondering; Python seems to include database adapters for almost any important database, all with a unified API. Why would you need another database abstraction on top of that? Thanks, -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating database structures in a portable way

2006-09-19 Thread Samuel
playing with it, and I really doubt you'll want to come back > to the embedded hand-written SQL !-) If I ever write something from scratch I'll use it. Thanks for your comments, this was very helpful. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Instantiating an object when the type is only known at runtime

2006-10-03 Thread Samuel
Hi, I am trying to replace the eval() in the following code: def myfunc(type, table): module = __import__(type) type = 'module' + '.' + type obj = eval(type) return obj(row[table.c.name], row[table.c.handle]) I am out of ideas. Any hints? Thank

Re: Instantiating an object when the type is only known at runtime

2006-10-03 Thread Samuel
oaded: module = __import__(type) obj= getattr(module, type) else: obj= globals().get(type) resource = obj(my_arg1, my_arg2) Thanks again, -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Running scripts in a sandbox

2006-10-03 Thread Samuel
not allow me to apply any changes OS-wise (standard web hoster), so I have no way to run the plugin in another process. I found a reference to rexec using Google, but apparently it was removed due to security issues in Python 2.3. Is there antoher way to do this? Thanks, -Samuel -- http

Automating a telnet session with an echo to stdout

2007-06-02 Thread Samuel
just want him to see what's going on. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Automating a telnet session with an echo to stdout

2007-06-04 Thread Samuel
On Sat, 02 Jun 2007 17:41:01 +, Samuel wrote: > I am trying to automate a telnet session (currently using Python's > telnetlib) and would like to echo any response of the remote host to > stdout, as soon as it arrives on telnetlib's open TCP socket. For the records: Bec

Re: which "GUI module" you suggest me to use?

2007-06-06 Thread Samuel
nd Windows, but doens't use native widgets > under Windows, so it won't look like a "normal" windows app. Gtk on Win32 can be themed to looked like Windows, AFAIK the Win32 installer does this by default since a couple of months. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: which "GUI module" you suggest me to use?

2007-06-06 Thread Samuel
On Wed, 06 Jun 2007 14:43:35 +, Grant Edwards wrote: > On 2007-06-06, Samuel <[EMAIL PROTECTED]> wrote: >> On Wed, 06 Jun 2007 00:22:40 +, Grant Edwards wrote: >>> wxPython works fine under Windows, Linux and OSX. >> >> wxPython emulates Gtk > >

Re: which "GUI module" you suggest me to use?

2007-06-06 Thread Samuel
On Wed, 06 Jun 2007 09:45:48 -0500, Chris Mellon wrote: > On 6/6/07, Samuel <[EMAIL PROTECTED]> wrote: > In the general case, wxWidgets wraps (not emulates) Gtk. I don't believe > that there are any common controls left which are still emulated (maybe > the list control?

Trivial string substitution/parser

2007-06-17 Thread Samuel
Hi, How would you implement a simple parser for the following string: --- In this string $variable1 is substituted, while \$variable2 is not. --- I know how to write a parser, but I am looking for an elegant (and lazy) way. Any idea? -Samuel -- http://mail.python.org/mailman/listinfo/python

Re: Trivial string substitution/parser

2007-06-17 Thread Samuel
me = match.group(2) value = get_variable(varname) return prepend + value string_re = re.compile(r'(^|[^\\])\$([a-z][\w_]+\b)', re.I) input = r'In this string $variable1 is substituted,' input += 'while \$variable2 is not.' print str

Retrieving a stacktrace from an exception object / forwarding an exception

2007-06-22 Thread Samuel
except Exception, e: f = open("logfile", 'a') f.write(e.stacktrace()) raise e wrapper() # should throw the exception with a stacktrace showing my_func() --- Any idea if and how this can be done? -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Retrieving a stacktrace from an exception object / forwarding an exception

2007-06-22 Thread Samuel
Thanks, Guys, this works as expected. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: Exscript 0.9 (Initial Release)

2007-06-29 Thread Samuel
Introduction - Exscript is a scripting language for automating Telnet or SSH sessions. It supports a wide range of features, such as parallelization, AAA authentication methods, TACACS, and a very simple template language. Exscript itself is written in Python, and it should run on a

Debugging "broken pipe" (in telnetlib)

2007-07-03 Thread Samuel
how to debug such a problem? How can I find out what broke the pipe? -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging "broken pipe" (in telnetlib)

2007-07-03 Thread Samuel
non-shared) instance of telnetlib and connects to a remote host. Are there any special conditions that must be taken care of when opening a number of sockets in threads? (The code runs on AIX 4.1, where Python supports native OS threads.) -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging "broken pipe" (in telnetlib)

2007-07-04 Thread Samuel
Thanks for your comments, Jean-Paul. -- http://mail.python.org/mailman/listinfo/python-list

Components for a client/server architecture

2007-05-20 Thread Samuel
r too incomplete I apologize; the problem is that I still find it hard to tell which requirements actually matter. If you have any pointers that might be of interest for such an architecture, please let me know. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Components for a client/server architecture

2007-05-21 Thread Samuel
act that it sucks big time anyway) SOAP seems well suited for web services. But it comes with quite some overhead, I tend to say that it's not a perfect fit for our purpose. Thank you for your comment! -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Components for a client/server architecture

2007-05-22 Thread Samuel
of things. As for CORBA, I had a closer look at Omniorb and it looks powerful, pretty much exactly what I was looking for. Thanks! -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Simple omniORBpy example throws exception with error 0x41540002

2007-05-22 Thread Samuel
don't understand how it works. Can anyone please explain this? -Samuel -- http://mail.python.org/mailman/listinfo/python-list

omniORBpy: Error 0x41540002

2007-05-22 Thread Samuel
don't understand how it works. Can anyone please explain this? -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple omniORBpy example throws exception with error 0x41540002

2007-05-22 Thread Samuel
-server-2 - orbit-name-server-2 & - Add to /etc/omniORB4.cfg: InitRef = NameService=IOR:01002b00... (where everything starting from "IOR:" is the output given by orbit- name-server-2. However, this does not seem to change the behavior. Any hints? Thanks, -Samuel -- http://mai

Re: omniORBpy: Error 0x41540002

2007-05-22 Thread Samuel
On May 22, 2:53 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Please see my answer to your first post. Gaa, Google's web client reported an error where there was none. Sorry about the repost. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple omniORBpy example throws exception with error 0x41540002

2007-05-22 Thread Samuel
-server-2 - orbit-name-server-2 & - Add to /etc/omniORB4.cfg: InitRef = NameService=IOR:01002b00... (where everything starting from "IOR:" is the output given by orbit- name-server-2. However, this does not seem to change the behavior. Any hints? Thanks, -Samuel -- http://mai

Re: Simple omniORBpy example throws exception with error 0x41540002

2007-05-24 Thread Samuel
Google for how), or use omniORB's naming service, which listens on > TCP by default. Yay, after replacing orbit2-nameserver by omniorb4-nameserver everything works fine. Thanks a lot for your comment! -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: PyGTK and HTML rendering?

2007-05-26 Thread Samuel
59390 It shouldn't be too hard to do, sounds like a nice project? :-) -Samuel -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: Spiff Workflow 0.0.1 (Initial Release)

2007-08-03 Thread Samuel
ttp://code.google.com/p/spiff/issues/list Documentation: http://spiff.googlecode.com/svn/trunk/libs/Workflow/README Browse the source: http://spiff.googlecode.com/svn/trunk/libs/Workflow/ If you have any questions, please do not hesitate to ask. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: python video editing libs

2007-08-18 Thread Samuel
On Sat, 18 Aug 2007 12:55:47 +1200, DavidM wrote: > Does anything like this exist? GStreamer/GNonLin might possibly support what you are looking for, though I have not tested this. http://docs.programmers.ch/index.php/Using_Gnonlin_with_GStreamer_and_Python -Samuel -- http://mail.python.

Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread Samuel
n.vim $ wget http://code.google.com/p/snippetsemu/issues/attachment?aid=-6063627743376712928&name=python_snippets.vim $ cp python_snippets.vim $HOME/.vim/after/ftplugin/ $ echo "syntax on set sw=2 set ts=2 set nu set nuw=3 set autoindent set expandtab" >> $HOME/.vimrc -

Re: Hot subject: a good python editor and/or IDE?

2007-08-19 Thread Samuel
On Sun, 19 Aug 2007 13:08:35 +, Samuel wrote: > $ sudo apt-get install vim I just realized, this should be $ sudo apt-get install vim-python or $ sudo apt-get install vim-full -Samuel -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: Spiff Workflow 0.0.2

2007-08-29 Thread Samuel
er: http://code.google.com/p/spiff/issues/list Documentation: http://spiff.googlecode.com/svn/trunk/libs/Workflow/README Browse the source: http://spiff.googlecode.com/svn/trunk/libs/Workflow/ If you have any questions, please do not hesitate to ask. -Samuel -- http://mail.python.org/mailman/listinf

Python object <-> XML

2007-09-03 Thread Samuel
Hi, Say you have the following XML: item 1 item 2 my group Is there an easy way (i.e. without writing a sax/dom parser) to load this into a (number of) Python object(s), manipulate the instance, and save the result back to XML? -Samuel -- http://mail.python.org/mailman

Re: Python object <-> XML

2007-09-03 Thread Samuel
where a list is required, but an existing mapper will surely have a solution implemented.) I guess what I am looking for is pretty much an ORM that also works with XML. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

ImportError depending on the calling module

2007-09-06 Thread Samuel
last): File "start2.py", line 4, in import test.foo File "/home/sab/test/foo/__init__.py", line 1, in from FooTest import FooTest File "/home/sab/test/foo/FooTest.py", line 1, in from Obj import Obj ImportError: No module named Obj - How would y

Re: ImportError depending on the calling module

2007-09-06 Thread Samuel
On Sep 6, 5:44 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > On 6 sep, 08:47, Samuel <[EMAIL PROTECTED]> wrote: > > Given the following directory structure: > > > - > > |-- Obj.py > > |-- __init__.py > > |-- foo > > | |-

Re: ImportError depending on the calling module

2007-09-06 Thread Samuel
On Sep 6, 6:13 pm, Samuel <[EMAIL PROTECTED]> wrote: > Why does it matter whether I install it in sys.path or whether > sys.path is modified? What's the difference? > > What I am doing is I ship two modules in one tarball with my software. > The software is only unpack

Re: ImportError depending on the calling module

2007-09-06 Thread Samuel
On Sep 6, 6:44 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > On 6 sep, 13:13, Samuel <[EMAIL PROTECTED]> wrote: > > > On Sep 6, 5:44 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > > They should import the package as any other > > >

ANNOUNCE: Exscript 0.9.8

2007-09-10 Thread Samuel
Introduction - Exscript is a scripting language for automating Telnet or SSH sessions. It supports a wide range of features, such as parallelization, AAA authentication methods, TACACS, and a very simple template language. Python developers can easily extend Exscript templates using

CGI handler: Retrieving POST and GET at the same time

2007-03-10 Thread Samuel
ieve the GET variables in that context? -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI handler: Retrieving POST and GET at the same time

2007-03-10 Thread Samuel
On Mar 10, 8:45 pm, "Pierre Quentel" <[EMAIL PROTECTED]> wrote: > To get the key-value dictionary : > > cgi.parse_qs(os.environ["QUERY_STRING"]) Thanks a lot, it works! -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Converting a list to a dictionary

2007-03-14 Thread Samuel
Hi, is there a short version for this? res_dict = {} for resource in res_list: res_dict[resource.get_id()] = resource This does not work: res_dict = dict([r.get_id(), r for r in res_list]) -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a list to a dictionary

2007-03-14 Thread Samuel
sure I had tested the latter, but I must have been doing something wrong. Thanks for your help! -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a list to a dictionary

2007-03-14 Thread Samuel
self.id = 5 ... >>> mylist = [] >>> for i in range(100): ... p = Person() ... p.id = i ... mylist.append(p) ... >>> mydict = dict((r.id,r) for r in mylist) >>> mydict What this does is it maps the id to the object. In your case, you only h

Re: Converting a list to a dictionary

2007-03-14 Thread Samuel
On Mar 14, 9:48 pm, "Drew" <[EMAIL PROTECTED]> wrote: > This is interesting behavior, but may not be what the original poster > intended. I am the original poster :). > If I understand correctly, this means that if more than one > object shares the same id, only one copy will be created in the di

MIME Magic

2007-03-17 Thread Samuel
Hi, How can I determine the type of a file from "magic bytes", similar to what the "file" command on unix does? I found http://docs.python.org/lib/module-mimetypes.html but this only seems to use the filename (extension) for finding the type. Any hints? -Samuel -- ht

Re: MIME Magic

2007-03-17 Thread Samuel
sler.net/library/file_sigs.html > > And here's an example of an authoritative source for that > table:http://www.libpng.org/pub/png/spec/1.2/PNG-Structure.html Actually, I am looking for an existing solution because I do not want to write it from scratch... I hope I am not out of op

ANNOUNCE: Exscript 0.9.9

2007-09-25 Thread Samuel
Introduction - Exscript is a scripting language for automating Telnet or SSH sessions. It supports a wide range of features, such as parallelization, AAA authentication methods, TACACS, and a very simple template language. This release comes with many new features, and the documentatio

Announcing: Spiff Guard (Generic Access Lists for Python)

2007-01-14 Thread Samuel
/list Documentation: http://spiff.googlecode.com/svn/trunk/libs/Guard/README Browse the source: http://spiff.googlecode.com/svn/trunk/libs/Guard/ Any questions, please ask (or file a bug). -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Distutils: Python version information

2007-02-18 Thread Samuel
://docs.python.org/dist/meta-data.html is incomplete (for example, the "provides" and "requires" keywords are not listed, even though covered in the previous chapters of the documentation). -Samuel -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: Exscript 0.9.11

2007-11-20 Thread Samuel
Introduction - Exscript is a scripting language for automating Telnet or SSH sessions. It supports a wide range of features, such as parallelization, AAA authentication methods, TACACS, and a very simple template language. Please refer to the project page for updated documentation (se

Listing subtypes

2007-11-28 Thread Samuel
Hi, I remember seeing an easy way to list all subtypes of a specific type but I haven't been able to find it anymore. What I am trying to do is this: Given a class, get a list of all classes that derive from it. Pretty much like __mro__ but downwards rather then upwards. Any ideas? -S

Re: Listing subtypes

2007-11-28 Thread Samuel
On Nov 29, 1:54 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > print A.__subclasses__() Ah, I knew I had seen this before. Thanks! -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Detecting mod_rewrite via CGI

2007-11-29 Thread Samuel
return False for line in file: if line.startswith('RewriteEngine on'): file.close() return True file.close() return False Unfortunately, not using .htaccess isn't an option. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: Spiff Guard 1.9.0

2007-12-02 Thread Samuel
le.com/p/spiff/ Mailing list: http://groups.google.com/group/spiff-devel Bug tracker: http://code.google.com/p/spiff/issues/list Browse the source: http://spiff.googlecode.com/svn/trunk/libs/Guard/ If you have any questions, please do not hesitate to ask or file a bug. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Generating API documentation as a textfile

2007-12-03 Thread Samuel
Does anyone know an easy way to extract the API documentation that is embedded into a Python file as a text file? -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating API documentation as a textfile

2007-12-03 Thread Samuel
On Mon, 03 Dec 2007 06:45:45 -0800, Giampaolo Rodola' wrote: > dir.__doc__ This contains only the docstring one object (module, class, function, ...). I was thinking more of the complete API documentation that can be found in a file, and formatted in a readable way. -Samuel

Re: highscores list

2007-12-08 Thread Samuel
; arising when it goes to read in the high scores from the file when I > play again. Not your original problem, but you should want to look at this instead of creating yet another parser: http://docs.python.org/lib/RawConfigParser-objects.html -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Ruby's Template Engine for Python

2007-12-08 Thread Samuel
es with AJAX like that looks inherently cool. Is there anything like that for Python, optimally a stand-alone library? Django seems to handle this differently, from what I can see. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Ruby's Template Engine for Python

2007-12-08 Thread Samuel
at, now I just have to find the piece of code that provides those callbacks. Ah, here it is: > http://pylonshq.com/WebHelpers/module-webhelpers.html And there I go, easily adding the same functionality to any template system of my choice. That was easier than I expected. Thanks for your h

Re: a strange SyntaxError

2007-12-09 Thread Samuel
On Sun, 09 Dec 2007 12:35:46 -0800, CoolGenie wrote: > OK, sorry, this was about indents. Stupid VIM! $ mkdir -p $HOME/.vim/ftplugin/ $ echo "setlocal sw=4 setlocal ts=4 noremap py o/**/ " >> ~/.vim/ftplugin/python.vim $ echo "syntax on set sw=2 set ts=2 set nu set nuw=3 set autoin

ANNOUNCE: Spiff Integrator 0.1

2007-12-27 Thread Samuel
/libs/Integrator/ If you have any questions, please do not hesitate to ask or file a bug. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

ANN:proxysocket(socks4,socks5)v0.1

2008-01-17 Thread Samuel
http://code.google.com/p/proxysocket/downloads/list -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN:proxysocket(socks4,socks5)v0.1

2008-01-18 Thread Samuel
On 1月18日, 下午3时04分, Tim Roberts <[EMAIL PROTECTED]> wrote: > Samuel <[EMAIL PROTECTED]> wrote: > > >http://code.google.com/p/proxysocket/downloads/list > > Allow me to introduce you to the concept of comments. Python allows you to > include descriptive sentences

Re: ANN:proxysocket(socks4,socks5)v0.1

2008-01-19 Thread Samuel
v0.2 http://proxysocket.googlecode.com/files/ProxySocket.py On 1月18日, 下午3时04分, Tim Roberts <[EMAIL PROTECTED]> wrote: > Samuel <[EMAIL PROTECTED]> wrote: > > >http://code.google.com/p/proxysocket/downloads/list > > Allow me to introduce you to the concept of c

Re: Protocol for thread communication

2008-03-04 Thread Samuel
a status to each job is by adding a status attribute to the Job class, in addition, a Job may emit a signal (using a simple signal/event mechanism such as this one: http://code.google.com/p/exscript/source/browse/trunk/lib/Exscript/ Trackable.py ) whenever a status changes, and have the MainLoo

Apache/mod_python: Registering a request handler dynamically

2008-12-28 Thread Samuel
d') RequestHandler(index) --- So at the time at which RequestHandler() is created, I need a way to make sure that mod_python calls to the RequestHandler instead of the normal handler, whenever a new request is made. Any idea? -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Resizing Tif's to smaller gifs adds pixels

2008-10-21 Thread Samuel
Scott, I appreciate the quick response, but I need this in a GIF format. Samuel On Oct 21, 3:46 pm, Scott David Daniels <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > ...I need to scale a TIFF image from 1925x588 px to a GIF of 600xnnn px. > > I've tried

Re: 2 + 2 = 5

2012-07-15 Thread samuel . marks
On Friday, July 6, 2012 8:39:58 AM UTC+10, Andrew Cooper wrote: > On 05/07/2012 22:46, Evan Driscoll wrote: > > On 01/-10/-28163 01:59 PM, Alexander Blinne wrote: > >> 5+0 is actually 4+0, because 5 == 4, so 5+0 gives 4. > >> 5+1 is actually 4+1, which is 5, but 5 is again 4. > >> 5+2 is 4+2 which

Force Python ast to emit lines no longer than $length

2021-01-19 Thread Samuel Marks
I've written a library that works at the ast level. Sometimes the generated output goes over the linter line length limit. "foo_bar_can_haz_foo_bar_can_haz_foo_bar_can_haz_foo_bar_can_haz_foo_bar_can_haz_foo_bar_can_haz" How do I generate this kind of code instead? "foo_bar_can_haz_foo_bar_can_h

Re: Force Python ast to emit lines no longer than $length

2021-01-21 Thread Samuel Marks
I ended up adding word-wrap support directly to my code-generation: https://github.com/SamuelMarks/doctrans/commit/6147b21e168b66623aa1be95cb38b1969daa5147 Samuel Marks Charity <https://sydneyscientific.org> | consultancy <https://offscale.io> | open-source <https://gith

Re: Running python from pty without prompt

2016-12-09 Thread Samuel Williams
Just in case it's not clear, this is running on a (virtual) PTY. -- https://mail.python.org/mailman/listinfo/python-list

Re: Running python from pty without prompt

2016-12-13 Thread Samuel Williams
Michael, yes. FYI, I found out why this works. Pressing Ctrl-D flushes the input buffer. If you do this on an empty line, it causes read(...) to return 0 which Ruby considers end of input for the script, but the pipe is not closed. -- https://mail.python.org/mailman/listinfo/python-list

Re: Running python from pty without prompt

2016-12-14 Thread Samuel Williams
Here are some examples of different languages: https://github.com/ioquatix/script-runner/blob/master/examples/python-eot.py -- https://mail.python.org/mailman/listinfo/python-list

Using SSML in Python script/program

2016-04-14 Thread Samuel M.
I need to use SSML (Synthesized Speech Markup Language) to play an audio file with the tag in my Alexa Skill (as per Amazon's instructions). Problem is, I don't know how to use SSML with Python. I know I can use it with Java but I want to build my skills with Python. I've looked all over, but

Re: [poliastro-dev] ANN: poliastro 0.13.0 released 🚀

2019-08-10 Thread Samuel Lelièvre
Le mar. 6 août 2019 à 08:33, Samuel Dupree a écrit : > Juan Luis Cano, > > When will poliastro ver. 0.13.0 become available from Anaconda? At the > time of this note, only ver. 0.12.0 is available. > > Lastly what is the recommended procedure to update poliastro from vers.

ABC with abstractmethod: kwargs on Base, explicit names on implementation

2020-08-24 Thread Samuel Marks
: def foo(self, a, b): """ :param a: var :type a: ```int``` :param b: var :type b: ```int``` """ super(Pharm, self).foo(a=a) Thanks, Samuel Marks Charity <https://sydneyscientific.org> | consultancy &

Re: ABC with abstractmethod: kwargs on Base, explicit names on implementation

2020-08-26 Thread Samuel Marks
lso a little project I wrote that `import ast`). What are my options here? - It doesn't seem like the metaclass or decorator approaches will help here… Samuel Marks Charity <https://sydneyscientific.org> | consultancy <https://offscale.io> | open-source <https://github.com/of

Re: ABC with abstractmethod: kwargs on Base, explicit names on implementation

2020-08-29 Thread Samuel Marks
I really am looking for handling both interfaces in a straightforward manner. Thanks for your suggestions, Samuel Marks Charity <https://sydneyscientific.org> | consultancy <https://offscale.io> | open-source <https://github.com/offscale> | LinkedIn <https://linkedin.com/i

Re: ABC with abstractmethod: kwargs on Base, explicit names on implementation

2020-08-29 Thread Samuel Marks
ole `Animal` [duck type] trick where `Animal` could actually be `Dog` or `Horse` [making the obvious Base `ABC` & `abstractmethod` approach 'wrong'] 1. Each implementer framework can maintain wildly different internal APIs, making more hardcore integrations—in a multi-ML sense—far

CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread Samuel Marks
oach wouldn't give nice `--help` text. What's the right solution here? Thanks, Samuel Marks Charity <https://sydneyscientific.org> | consultancy <https://offscale.io> | open-source <https://github.com/offscale> | LinkedIn <https://linkedin.com/in/samuelmarks> -- https://mail.python.org/mailman/listinfo/python-list

Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread Samuel Marks
Maurer wrote: > Samuel Marks wrote at 2020-10-15 20:53 +1100: > > ... > >To illustrate the issue, using `ml-params` and ml-params-tensorflow: > > ... > >What's the right solution here? > > While Python provides several modules in its standard library > to pr

Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread Samuel Marks
Simpson wrote: > One other thing: > > On 15Oct2020 20:53, Samuel Marks wrote: > >Idea: preprocess `sys.argv` so that this syntax would work > >`--optimizer Adam[learning_rate=0.01]`* > > > >*square rather than round so as not to require escape characters or >

Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread Samuel Marks
to expose this as CLI options. `--optimizer Adam` is a good first step, but it should error if I try and give it `momentum`. The comma syntax is my favourite so far. I guess I'll just have to write a validator outside the CLI parser to handle this… Samuel Marks Charity <https://sy

Re: Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread Samuel Marks
amuelMarks/ml-params/blob/d1fb184/ml_params/__main__.py#L89 [I didn't know `getopt` was exposed otherwise I'd use that , but there has to be a solution just using argparse?] Samuel Marks Charity <https://sydneyscientific.org> | consultancy <https://offscale.io> | open-sou

Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-16 Thread Samuel Marks
t; need to play on the command line. > > > > And yea, I’ve written a command line parsing function in C a long time > ago. I thought that really cool at the time. I wouldn’t want to do it now. > > > > Karen. > > > >> On Oct 15, 2020, at 9:58 PM, Samuel M

Static typing—with annotations—function name & arguments, or result of call, or string

2020-10-22 Thread Samuel Marks
lopped on for further analysis down the line? - So it can easily generate into `choices` for argparse? [which will need to be subclassed in order to enable that "--optimizer 'Adam' 'learning_rate = True'" syntax] * https://github.com/SamuelMarks/ml-params-tensorflow

Change directory not successfully done

2005-11-10 Thread Samuel Yin
I do in the case of python script? Thanks and Regards Samuel Yin -- http://mail.python.org/mailman/listinfo/python-list

Re: Change directory not successfully done

2005-11-10 Thread Samuel Yin
Regards Samuel Yin Mike Meyer 写道: Samuel Yin <[EMAIL PROTECTED]> writes: Hi, guys, This should be a simple problem, but I just can not resolve it. I just want to use a python script to change my working directory. see my following code: # mycd.py 1) destdir = "&

Re: Unexpected behavior of read only attributes and super

2005-12-06 Thread Samuel M.Smith
ect attribute '__iter__' is read-only Then I get the read only exception but not because it was read only but because I defined slots. This looks like a logic error in how setattr is working in in the superclass dict *****

Re: Logging

2005-02-02 Thread Samuel Kilchenmann
f your use case is simply not covered. If you add something like .>>> logging._handlers.clear() .>>> logging.root.handlers = [] .>>> for l in logging.Logger.manager.loggerDict.values(): .>>> l.handlers = [] after logging.shutdown() and before getting the new logger, your script will probably run without errors. hth, Samuel -- http://mail.python.org/mailman/listinfo/python-list

Dependencies from git aren't being installed? (setuptools, pip)

2015-02-18 Thread Samuel Marks
I'm sure I've just misconfigured my setup.py, requirements.txt and/or project structure, but I've tried: * install_requires * requirements.txt * install_requires + dependency_links With (for install_requires): * bettertutors_sql_models==dev * bettertutors_sql_models For requirements.txt, depende

How to read a directory path from a txt file

2014-06-02 Thread Samuel Kamau
I have created a txt file with various paths to directories. The paths look like this /home/wachkama/Desktop/api/genshi /home/wachkama/Desktop/www/portal/schedule /home/wachkama/Desktop/show/help.genshi How do i read this paths in python ? -- https://mail.python.org/mailman/listinfo/python-list

Re: How to read a directory path from a txt file

2014-06-02 Thread Samuel Kamau
On Monday, June 2, 2014 10:18:25 AM UTC-4, Samuel Kamau wrote: > I have created a txt file with various paths to directories. The paths look > like this > > /home/wachkama/Desktop/api/genshi > > /home/wachkama/Desktop/www/portal/schedule > > /home/wachkama/

  1   2   >