Re: Convert the decimal numbers expressed in a `numpy.ndarray` into a matrix representing elements in fractional form

2022-05-23 Thread Cousin Stanley
> hongy... wrote > > This method doesn't work, as shown below: > ? b > > [0.0, -1.0, 0.0, 0.25] > [1.0, 0.0, 0.0, 0.25] > [0.0, 0.0, 1.0, 0.25] > [0.0, 0.0, 0.0, 1.0] > > a > > 0 0 0 1 > # --- Using debian 11.3 bullseye python 3.9

Re: Convert the decimal numbers expressed in a `numpy.ndarray` into a matrix representing elements in fractional form

2022-05-18 Thread Cousin Stanley
#!/usr/bin/env python3 ''' NewsGroup comp.lang.python Subject .. Convert the decimal numbers expressed in a numpy.ndarray into a matrix representing elements in fractiona Date . 2022-05-16 Post_By ..

Re: Suggestion for Linux Distro (from PSA: Linux vulnerability)

2022-03-11 Thread Cousin Stanley
Cousin Stanley wrote: >> apt-cache search lxqt | grep ^lxqt Chris Angelico wrote: > Much faster: > > apt-cache pkgnames lxqt > > apt-cache search will look for "lxqt" in descriptions too, > hence the need to filter those out > > apt-cache pkgnames

Re: Suggestion for Linux Distro (from PSA: Linux vulnerability)

2022-03-10 Thread Cousin Stanley
Marco Sulla wrote: >> >> Maybe Debian itself? > > I tried Debian on a VM, but I found it too much basical. A little > example: it does not have the shortcut ctrl+alt+t to open a terminal > that Ubuntu has. I'm quite sure it's simple to add, but I'm starting > to be old and lazy... > I use the

Re: Python LSTM forecast future values for time series

2022-02-12 Thread Cousin Stanley
Jorge Conforte wrote: > > I'm starting run the LSTM to forecast future values for time serie data. > > please can someone give me some information > on how i can predict future values ​​> for my time series using LSTM. Thanks, Conrado I cannot personlly help but a google search using

Re: What to write or search on github to get the code for what is written below:

2022-01-28 Thread Cousin Stanley
Dennis Lee Bieber wrote: > Ignoring the code spam I presume > I'm an sqlite user myself and was glad to see the code you posted and have a couple of tiny example book/author sql3 databases but nothing resembling an actual library check in/out program I've never used PySi

Re: What to write or search on github to get the code for what is written below:

2022-01-28 Thread Cousin Stanley
Dennis Lee Bieber wrote: > > How would you do this assignment on paper ? > Your patience and willingness to help and guide someone else with such a complete and understanable post is hihgly commendable. Thanks -- Stanley C. Kitching Human Being Phoenix, Arizona -- htt

Re: Where is the problem?

2021-02-27 Thread Cousin Stanley
RD wrote: > In article , cousinstan...@gmail.com says... > > [snip] > >> I have a couple of postscript saving examples >> that include the following geometry parameters >> which produce .ps files that render the same >> as the canvas drawings when viewed in ghostsript. > >> retva

Re: Where is the problem?

2021-02-26 Thread Cousin Stanley
RD wrote: > Python 3.4.3 on WinXP. > > I create a Tk canvas and draw on it with create_text(), > create_line(), and create_polygon with fill and stipple. > > So far, so good, looks fine on the screen. > > So I go to send it to a postsctript file: > > bmap.postscript(file="tmp.ps", colormode='c

Re: issue with seaborn

2021-02-20 Thread Cousin Stanley
Dino wrote: > trying to do some dayaviz with Italian Covid Open Data ( > https://github.com/italia/covid19-opendata-vaccini/ ) > > here's how I pull my data: > > import sys > import urllib.request > import pandas as pd > import ssl > ssl._create_default_https_context

Re: Seeking guidance to start a career in python programming

2020-11-05 Thread Cousin Stanley
ankur gupta wrote: > Good Morning to All, > My name is Ankur Gupta and I wish to seek guidance from you. > > I belong to a non-computer science background > but have always been attracted to this field. > > I had computer science in class 12th ( Where I learned C++ > and Python ) but I did

Re: How do I get datetime to stop showing seconds?

2020-10-16 Thread Cousin Stanley
Steve wrote: > d2 = datetime.datetime.now() #Time Right now > > Show this: 2020-10-16 02:53 > and not this: 2020-10-16 02:53:48.585865 > > > == > Footnote: > If you double major in psychology and reverse psychology, to they cancel > e

Re: How do I place a preset into the text box?

2020-08-28 Thread Cousin Stanley
Steve wrote: > The following program compiles but does not quite do what I would like it to > do. Line 19 is the preset information but I do not seem to be able to get it > into the form by code. My purpose is to let the user make changes without > having to re-enter the entire code. > You

Re: Button press event - event handling and picking: IndexError: list index out of range

2020-06-09 Thread Cousin Stanley
Caledonian26 wrote: > However, I keep getting the error: > > IndexError: list index out of range. > > Could anyone give me a helping hand > as to where I am going wrong? > I appended a single arbitrary value for limits since the limits list had not been previously initial

Re: Floating point issue

2020-04-17 Thread Cousin Stanley
Aakash Jana wrote: > I am calculating couple of ratios and according to the problem > there must be a 6 decimal precision. > > But when I print the result I only get one 0. > > E.g:- 2 / 5 = 0.40 but I am only getting 0.4 You might try using a ' '.format string ratios = { '1/8'

Re: How to get filesystem in python.

2020-01-17 Thread Cousin Stanley
Antoon Pardon wrote: > I would like to get the information given by the df command on linux/unix. > I found the os.statvfs call, but it misses one thing: The filesystem. > > Does anyone know how to get that information. > import os pipe_in = os.popen( 'df -h -T -x tmpfs -x devtmpfs' ) lis

Re: upgrading python on raspbian

2019-10-16 Thread Cousin Stanley
Gene Heskett wrote: > Continueing this thread, I now have a missing function by name, "units", > that is preventing LinuxCNC from running. > > Where in the python 3 world do I find that function?, > Under debian buster there is a python 2 package called python-quantities that apparent

Re: question about making an App for Android

2019-10-15 Thread Cousin Stanley
Cousin Stanley wrote: > There is also a useful python package > called sunset which I fouund a reference to > on stackoverflow Maybe I'll wake up some time today :-) The python package is called suntime not sunset # pip3 show suntime -- Stanley C. Kitchi

Re: question about making an App for Android

2019-10-15 Thread Cousin Stanley
Cousin Stanley wrote: > > d_sse = sse_sunset - sse_sunrise # seconds of daylight > I think it might be required to convert utc time to local time for the difference in sunrise and sunset times to make sense in local time -- Stanley C. Kitching Human Bein

Re: question about making an App for Android

2019-10-15 Thread Cousin Stanley
Chris Angelico wrote: > Or maybe it's really simple, because there's an HTTP API >that > gives you the information. > > There's an API for everything these days. > > A quick web search showed up this: > > https://sunrise-sunset.org/api > There is also a useful python package c

Re: Enumerate - int object not subscriptable

2019-08-20 Thread Cousin Stanley
Sayth Renshaw wrote: > I want to do basic math with a list. > > a = [1, 2, 3, 4, 5, 6, 7, 8] > > for idx, num in enumerate(a): > print(idx, num) > > This works, but say I want to print the item value > at the next index as well as the current. > > for idx, num in enumerate(a): > > print(n

Re: Make sure the window title is visible in tkinter

2019-06-30 Thread Cousin Stanley
Cousin Stanley wrote >> You might try setting a given window geometry >> to accomodate the long title >> >> win_w = 400 >> win_h = 300 >> >> ofs_h = 40 >> ofs_v = 30 >> >> window.geometry( "%dx%d+%d+%d" % (

Re: Make sure the window title is visible in tkinter

2019-06-26 Thread Cousin Stanley
Cecil Westerhof wrote: > I need to write a desktop program. I choose to use tkinter. > > How can I make sure the window title is visible? For example > when I have the following code : > from tkinter import Button, filedialog, Label, messagebox, Tk > > > window = Tk() > wind

Re: polar coordinates?

2018-12-10 Thread Cousin Stanley
Brian Christiansen wrote: > > I guess my question is if python can do this natively > or if there is a package somewhere ( polar.py ? ) that can do this > You might consider matplotlib for polar coordinate plotting ... https://matplotlib.org/examples/pylab_examples/polar_demo.

Re: Program to keep track of success percentage

2018-12-10 Thread Cousin Stanley
Musatov wrote: > I am thinking about a program where the only user input is win/loss. > > The program let's you know if you have won > more than 31% of the time or not. > > Any suggestions about how to approach authoring > such a program? Thanks. The following results are from a python to

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-09 Thread Cousin Stanley
srinivasan wrote: > Even after changing as per the below > "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3" > or: > 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3' > or: > "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3" > > Still my output is: > */dev/mmcblk1p1: LABEL="efi" UUID="1084

Re: How to move the scrollbar to inside the text widget

2018-06-03 Thread Cousin Stanley
moidee...@gmail.com wrote: > I am a Newbie > > I have this code > > from tkinter import * > > root = Tk() > root.geometry("1200x1000+30+30") > # width x height + x_offset + y_offset: > T = Text(root, height=10, width=100) > T.place(x=20, y=30) > for i in range(40): >T.insert(END, "This is l

Re: Problem: Need galileo running on debian wheezy

2018-03-02 Thread Cousin Stanley
Gene Heskett wrote: > > And the rock64 doesn't have wifi hardware > that I know of. > I did manage to get wifi working on my rock64 using a usb wifi dongle ordered from their store It was a bit fiddly to set up, somewhat shaky connection-wise, and slower than I was com

Re: Problem: Need galileo running on debian wheezy

2018-03-01 Thread Cousin Stanley
Gene Heskett wrote: > I know its supposed to be in the debian stretch repo's. > > I've been told to get a fitbit, but they don't support linux > of any flavor, and that leaves galileo as the possible solution? > > So how should I proceed since the only stretch machine I have ATM > is an arm64,

Re: enum

2017-10-31 Thread Cousin Stanley
ast wrote: > https://docs.python.org/3.5/library/enum.html#planet > > Documentation says that the value of the enum > members will be passed to this method. > > But in that case __init__ waits for two arguments, mass > and radius, while enum member's value is a tuple. > > It seems that there is

Re: Get min and max dates

2016-12-08 Thread Cousin Stanley
DFS wrote: > > Not wanting to use any date parsing libraries, > If you happen reconsider date parsing libraries the strptime function from the datetime module might be useful #!/usr/bin/env python3 from datetime import datetime dates = [ '10-Mar-1998' , '20

Re: Python Dice Game/Need help with my script/looping!

2016-11-03 Thread Cousin Stanley
Constantin Sorin wrote: > Hello,I recently started to make a dice game in python. > > Everything was nice and beautiful,until now. > > My problem is that when I try to play and I win or lost > or it's equal next time it will continue only with that. > Following is a link to a version o

Re: Stupid question, just need a quick and dirty fix

2016-07-22 Thread Cousin Stanley
Jordan Bayless wrote: > > desired = Id < 10 or Id > 133 or Id in good_ids > > When I try to validate whether I passed that check, > I'm told there's a Name error and it's not defined > On the outside chance that failing to define Id produces the Name error, I defined Id in a fo

Re: Assignment Versus Equality

2016-06-26 Thread Cousin Stanley
Dennis Lee Bieber wrote: > > but I'm sure we'd have a revolt > if Python comparison operators looked like: > > a .eq. b > a .ne. b > a .gt. b .or. c .lt. d > a .le. b .and. c .ge. d > As someone who learned fortran in the mid 1960s and pounded a lot of fortran code in the 1970s

Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-23 Thread Cousin Stanley
DFS wrote: > On 6/23/2016 11:11 AM, Cousin Stanley wrote: >> DFS wrote: >> >>> Here's a fun one: scraping data off a website, >>> and storing it in a SQLite database file. >>> >> >> After testing your example code here I found &g

Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-23 Thread Cousin Stanley
DFS wrote: > Here's a fun one: scraping data off a website, > and storing it in a SQLite database file. > After testing your example code here I found that the length of the categories list was 1 less than the terms list after applying dropwords in the terms list comprehensio

Re: [OT'ish] Is there a list as good as this for Javascript

2016-03-25 Thread Cousin Stanley
> Occasionally I have to make forays into Javascript, > can anyone recommend a place similar to this list > where Javascript questions can be asked ? Several years back I found the newsgroup comp.lang.javascript to be helpful However, I haven't used that group for som

Re: pygtk2 and colors

2015-07-07 Thread Cousin Stanley
> With python 2.7.5, pygtk 2.24, gtk 2.24: > The following snippet successfully sets the line_width > but not the foreground color, and I can't figure-out why. > > The color human-name and the result returned > by gtk.gdk.color_parse are correct. Clues? Thanks. > > self.gc.set_line_attributes

Re: Classic OOP in Python

2015-06-18 Thread Cousin Stanley
> > python -m doctest application.py > > And from there, I would build up extra doc tests > An extra doc test that fails #!/usr/bin/env python """ NewsGroup comp.lang.python Subject .. Classic OOP in Python Date . 2015-06-17 Post_By ..

Re: Python Worst Practices

2015-02-28 Thread Cousin Stanley
> From : Tim Chase > > A quick google-and-tally for languages > and their corresponding number of keywords: > re-sorted 21 : Lua 31 : Python2.x 33 : Python3.x 33 : C 37 : Pike 40 : Perl 40 : Ruby 50 : Java 54 : Pascal

Re: pyqtgraph window position

2015-02-13 Thread Cousin Stanley
> I can control the size of my pyqtgraph window below with 'resize'. > > But how can I control the position on the screen? > Also, try w.setGeometry( x_pos , y_pos , width , height ) -- Stanley C. Kitching Human Being Phoenix, Arizona -- https://mail.python.org/mailman/listinf

Re: pyqtgraph window position

2015-02-13 Thread Cousin Stanley
> I can control the size of my pyqtgraph window below > with 'resize'. > > But how can I control the position on the screen ? > > import pyqtgraph as pg > > w = pg.GraphicsWindow() > w.resize(250,400) > > for i in range(4): > w.addPlot(0, i) > > def onClick(event): > but=event.button()

Re: Cairo module

2015-02-04 Thread Cousin Stanley
> You might consider using python-imaging > to display the image after writing it > from cairo > > import image import statement should be import Image note uppercase I -- Stanley C. Kitching Human Being Phoenix, Arizona -- https://mail.python.org/mailman/listinfo/py

Re: Cairo module

2015-02-04 Thread Cousin Stanley
> > Could matplotlib be used to show the image? You might consider using python-imaging to display the image after writing it from cairo import image surface.write_to_png ( "x_surface.png" ) img = Image.open( "x_surface.png" ) img.show( command = 'display' )

Re: Beginner question - class definition error

2015-01-28 Thread Cousin Stanley
> from kivy.app import App > from kivy.uix.label import Label > > class MyApp(App): > def build(self): > return Label(text='Hello World') > > if __name__ == '__main__': > MyApp().run() > > > > I get this error when I run it: > > > Traceback (most recent call last): > File

Re: Glade/Python - positioning main window at startup

2014-12-30 Thread Cousin Stanley
> > Problem: Can anyone help me find settings (either in Glade or elsewhere) > which will start the application window with the application window center > aligned with the desktop center ? You might try the following entry in your .glade file center -- Stanley C. Kitch

Re: pack circles into a partial annulus

2014-11-20 Thread Cousin Stanley
> I need to pack circles into a partial annulus ie part of a larger circle > bounded by two radii and angles of say 18 & 90. You might take a look at Descartes Circle Theorem http://en.wikipedia.org/wiki/Descartes'_theorem Blub from google search In geometry, Descartes

Re: Dictionaries with variable default.

2014-11-04 Thread Cousin Stanley
> So How should I call this: > > class ...dict(dict): > def __init__(self, fun): > self.fun = fun > > def __missing__(self, key): > return self.fun(key) I don't know how you should, but I tried the following which seems to work class KeyPlusOne( dict ) : def __

Re: [ANN] dbf v0.96 is released

2014-10-28 Thread Cousin Stanley
> > dbf > === > > dbf (also known as python dbase) is a module > for reading/writing dBase III, FP, VFP, > and Clipper .dbf database files. > Available via PyPI at ? https://pypi.python.org/pypi/dbf/0.96.001 -- Stanley C. Kitching Human Being Phoenix, Arizona -- https://ma

Re: Top down Python

2014-02-12 Thread Cousin Stanley
> > 3) Create terminal window with size 64x20 > (which, IMO, is tiny) > Maybe 64 characters x 20 lines -- Stanley C. Kitching Human Being Phoenix, Arizona -- https://mail.python.org/mailman/listinfo/python-list

Re: need to print seconds from the epoch including the millisecond

2013-12-30 Thread Cousin Stanley
>> You might consider either turning off an option >> in your news client for including message in reply >> and/or snipping all but a few lines for context >> to prevent us from seeing the double line spacing >> all over again :-) > Great idea, but one slight snag is > the poster then does

Re: need to print seconds from the epoch including the millisecond

2013-12-30 Thread Cousin Stanley
>> On 30/12/2013 12:16, matt.doolittl...@gmail.com wrote: >> >> >> thanks a bunch. the "%.6f" was the cure. >> can you please point me to the doc for formatting time? >> Thanks! >> > Would you please read and action this > https://wiki.python.org/moin/GoogleGroupsPython > to prevent

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-17 Thread Cousin Stanley
Rick Johnson wrote: Dovetails are nothing more than sadistic nostalgia -- they give old men a "chubby" and young men a nightmare. There is nothing more satisfying than cutting a set of dovetails by hand and having them glide together like silk, the first time you test-fit them, with no da

Re: [newbie] struggling wth tkinter

2013-12-08 Thread Cousin Stanley
> > This is what I get: > > Traceback (most recent call last): > File "./feet2meters.py", line 2, in > from tkinter import * > File "/home/jean/tkinter.py", line 2, in > import Tkinter as tk > ImportError: No module named Tkinter > From your original post I only changed the she-bang

Re: [newbie] struggling wth tkinter

2013-12-07 Thread Cousin Stanley
> > The only thing I see when running it is a little popup > with "Click mouse here to quit" which works as expected > but always shows the following error-message. This seems to be left over from an earlier post where you were binding a mouse event to a tk label Did you create a

Re: python 3.3 repr

2013-11-15 Thread Cousin Stanley
> > We don't say len({42: None}) to discover > that the dict requires 136 bytes, > why would you use len("heåvy") > to learn that it uses 23 bytes ? > #!/usr/bin/env python # -*- coding: utf-8 -*- """ illustrate the difference in length of python objects and the size of thei

Re: The meaning of "doubt", was Re: Python Basic Doubt

2013-08-10 Thread Cousin Stanley
Peter Otten wrote: > > doubt > Oh bother, said Pooh, what's in a word ? http://en.wikipedia.org/wiki/Curry https://pypi.python.org/pypi/curry/ http://en.wikipedia.org/wiki/Currying -- Stanley C. Kitching Human Being Phoenix, Arizona -- http://mail.python.org/mailm

Re: [tkinter] trouble running imported modules in main program

2013-08-07 Thread Cousin Stanley
Terry Reedy wrote: > Code comments : > > double and triple spacing code > make it painful to read, Not for everyone :-) I prefer mostly double-spaced code in any language > especially in a 10 line box. Agree, but the 10 line box would not be used for routin

Re: Can someone suggest better resources for learning sqlite3? I wanted to use the Python library but I don't know sql.

2013-08-03 Thread Cousin Stanley
Aseem Bansal wrote: > > Can someone suggest me better resources > for learning sql/sqlite3 ? http://docs.python.org/3/library/sqlite3.html http://wiki.python.org/moin/DbApiCheatSheet http://www.w3schools.com/sql/default.asp http://www.sqlcourse.com/index.html http://sqlite.org

Re: Looking for a name for a deployment framework...

2013-06-24 Thread Cousin Stanley
jonathan.slend...@gmail.com wrote: > Any suggestions for a good name, > for a framework that does > automatic server deployments ? asdf : automatic server deployment framework -- Stanley C. Kitching Human Being Phoenix, Arizona -- http://mail.python.org/mailman/listinfo/python-list

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-14 Thread Cousin Stanley
Steven D'Aprano wrote: > On Fri, 12 Apr 2013 23:26:05 +, Cousin Stanley wrote: > >> The firefox browser keeps different sqlite database files for various >> uses > > Yes, and I *really* wish they wouldn't. > > It's my number 1 cause of

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-12 Thread Cousin Stanley
someone wrote: > > So SQLite is very good for "practicing" > Yes it is but it is also very good for much more than just practice Check the wikipedia info http://en.wikipedia.org/wiki/Sqlite "It is arguably the most widely deployed database engine, as

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-12 Thread Cousin Stanley
someone wrote: > As you can see, on my system I > had to use: > > print row[0] , row[1] > > instead of: > > print row[ 'xtime' ] , row[ 'col4' ] > > I'm not sure exactly why The magic there is setting up the row_factory after the database connection dbc = DBM.connect( 'some.s

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-11 Thread Cousin Stanley
Cousin Stanley wrote: > The stand-alone sqlite interpreter can first be used > to create an empty database named some.sql3 > and create a table named xdata in that data base > > sqlite3 some.sql3 '.read xdata_create.sql' This step can also be done

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-11 Thread Cousin Stanley
someone wrote: > > I want to put this table into an appropriate container > such that afterwards I want to: > > 1) Put the data into a mySql-table > You might consider using sqlite3 as a database manager since it is "batteries included" with python The stand-alone sqlite

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-10 Thread Cousin Stanley
someone wrote: > > I want to put this table into an appropriate container > such that afterwards I want to: > > 1) Put the data into a mySql-table > 2) Be able to easily plot column 1 vs. either of the other columns > using matplotlib etc... > Consider editing your data file into

Re: can anyone help me in developing a simple webpage in jinja2

2013-04-07 Thread Cousin Stanley
Satabdi Mukherjee wrote: > i am a rookie in python and i am trying > to develop a simple webpage using jinja2. > > can anyone please help me how to do that You might try using your jinja template with named tuples # --- from jinja2 import Tem

Re: Performance of int/long in Python 3

2013-03-26 Thread Cousin Stanley
Chris Angelico wrote: > Once again, Py3 is slower on small integers than Py2. Chris Angelico Ubuntu Karmic. Pentium(R) Dual-Core CPU E6500 @ 2.93GHz. python inline range_sum forloop forloop_offset 2.6.4 2.7050 2.6492 6.5877 16.5168 3.1.1 4.4453 4.3731 12

Re: Performance of int/long in Python 3

2013-03-26 Thread Cousin Stanley
Chris Angelico wrote: > Interesting, so your 3.x sum() is optimizing something somewhere. > Strange. Are we both running the same Python ? > > I got those from apt-get > I also installed python here under Debian Wheezy via apt-get and our versions look to be the same -sk-

Re: Performance of int/long in Python 3

2013-03-25 Thread Cousin Stanley
Chris Angelico wrote: > The Python 3 merge of int and long has effectively penalized > small-number arithmetic by removing an optimization. > > The cost is clear. > The cost isn't quite as clear under Debian Wheezy here Stanley C. Kitching Debian Wheezy python inlin

Re: Import Json web data source to xls or csv

2013-02-19 Thread Cousin Stanley
io wrote: > > How do i manage to read the data source > from http://bitcoincharts.com/t/markets.json > > I just need currency, symbol, bid, ask, volume > Following is a simple way load the json data and write the desired fields to a .csv file import json import urllib url

Re: Fast forward-backward (write-read)

2012-10-23 Thread Cousin Stanley
Virgil Stokes wrote: > Not sure about "tac" --- could you provide more details on this > and/or a simple example of how it could be used for fast reversed > "reading" of a data file ? tac is available as a command under linux $ whatis tac tac (1) - concatenate and print files in re

Re: Eclipse and the Python plugin

2012-08-03 Thread Cousin Stanley
lipska the kat wrote: > > I can now create, debug and test a simple IRC server > written in Java and an IRC Bot that I am attempting > to build in Python > For a bit of inspiration python-irc-bot-wise you might look at supybot It's currently available in debian wheezy

Re: [newbie] problem with data (different behaviour between batch and interactive use)

2012-06-27 Thread Cousin Stanley
Jean Dupont wrote: > I have some data which is presented > in the following format to me : > > +3.874693E-01,+9.999889E-03,+9.91E+37,+1.876595E+04,+3.994000E+04 > > I'm only interested in the first two fields i.e. > > +3.874693E-01,+9.999889E-03 > The following program will read line

Re: python for android anyone?

2012-05-28 Thread Cousin Stanley
rusi wrote: > > Any specific tips will of course be welcome < but also the general idea > -- is android really python friendly (yet)? You might take a look at Kivy http://kivy.org/ "It is built with Cython ( C extensions for Python ) and, in order to create apps, Python

Re: Questions about "compiled" Python (beginner)

2012-01-29 Thread Cousin Stanley
This short article provides some basic information about .pyc and .pyo files http://www.network-theory.co.uk/docs/pytut/CompiledPythonfiles.html -- Stanley C. Kitching Human Being Phoenix, Arizona -- http://mail.python.org/mailman/listinfo/python-list

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-21 Thread Cousin Stanley
W. eWatson wrote: > My criterion for success is that it puts IDLE as a choice for editor > on the menu produced with a right-click on a py file. > > So far no response on this has solved the problem. > As an alternative you might consider adding a short-cut to IDLE to the Send To di

Re: learning another programing language

2011-07-24 Thread Cousin Stanley
Benjamin Gregg wrote: > > I want to know is there any good tutorials or tips > for learning C++/java after using python? You might find the following site to be useful java information http://mindprod.com/jgloss/jgloss.html -- Stanley C. Kitching Human Being Phoenix, Arizo

Re: python xauth

2011-07-10 Thread Cousin Stanley
kracekumar ramaraju wrote: > I am looking to use xauth in python ? > > It is for my command line process, > I would like to have few examples > and resources. A simple example >>> import subprocess as SP >>> >>> proc = [ 'xauth' , 'list' , ':0' ] >>> >>> pipe = SP.Popen( proc , stdo

Re: web browsing short cut

2011-07-07 Thread Cousin Stanley
Chris Angelico wrote: > > > http://blah/blah";> > http://another/blah";> > > > http://third/blah";> > http://final/blah";> > > > > That should divide your screen four ways > ( if I haven't botched my HTML > - ages since I've used frames ). html !botched :-

Re: Automatic placement of a text box? ie empty legend [matplotlib]

2011-06-29 Thread Cousin Stanley
Christopher Barrington-Leigh wrote: > I'd like to have the Sample A box place itself > in the optimal empty space, so as not to overlay > any graphing elements (if possible): > A simple alternative might be to place the label just outside of the plot region either at the top or the

Re: NEED HELP-process words in a text file

2011-06-26 Thread Cousin Stanley
Steven D'Aprano wrote: > If ONE word in uppercase is read in a SLIGHTLY louder voice, > then naturally it doesn't take much imagination TO READ > EVEN QUITE SHORT PASSAGES OF UNINTERRUPTED UPPERCASE WORDS > AS SHOUTING LOUDLY -- And it doesn't take much of a reality check through my own

Re: NEED HELP-process words in a text file

2011-06-24 Thread Cousin Stanley
John Gordon wrote: > In Cousin Stanley > writes: > >> How or why this behavior was cultivated >> and continues to spread is mind boggling > > The behavior of writing in all caps, > or the behavior of equating such writing with shouting ? The latter

Re: NEED HELP-process words in a text file

2011-06-24 Thread Cousin Stanley
Chris Rebert wrote: > Netiquette comment: Please avoid SHOUTING > The brilliant beam of light that first thought capitilized words amounted to shouting never programmed cobol, fortran, or pl/1 in the 1960s or 1970s :-) How or why this behavior was cultivated and contin

Re: pyGTK identify a button

2011-05-25 Thread Cousin Stanley
Tracubik wrote: > Hi all, > i'm trying to write a simple windows with two button in GTK, > i need a way to identify wich button is pressed. > #!/usr/bin/env python import gtk def console_display( button , args ) : a0 , a1 , a2 = args print '%s %s %s ' % ( a0 , a1 , a2

Only 7 Years

2011-03-29 Thread Cousin Stanley
On May 8, 2004 I posted a note[1] here in comp.lang.python with a subject line of Lost : Plot_Demo looking for a small 2d plot program that I had seen, misplaced, and which I thought came along as a demo with a PYTHON installation This morning after rooting about in an old JYT

Re: Suggested editor for wxPython on Ubuntu

2011-02-17 Thread Cousin Stanley
usenet.digi...@spamgourmet.com wrote: > Ok, I've decided that Boa Constructor is too buggy to be useful > under Ubuntu, so what would the team recommend for developing > Python projects with wxPython? Preferably with some GUI design capability? perhaps python-wxglade GUI designer w

Re: First time using an API...

2011-02-17 Thread Cousin Stanley
Matty Sarro wrote: > > I am in charge of deploying a platform to allow people > across my company to access a variety of crunched metrics > using splunk. > For the convenience of others that may not be familar with splunk http://en.wikipedia.org/wiki/Splunk http://

Re: Problem with giant font sizes in tkinter

2011-02-10 Thread Cousin Stanley
Steven D'Aprano wrote: > I have a tkinter application under Python 2.6 which is shows text > in a giant font, about twenty(?) times larger than expected. > > The fonts are set using: > > titlefont = '-Adobe-Helvetica-Bold-R-Normal-*-180-*' > buttonfont = '-Adobe-Helvetica-Bold-R-Normal-*-140-*' >

Re: IDLE: A cornicopia of mediocrity and obfuscation.

2011-02-01 Thread Cousin Stanley
rantingrick wrote: > Terry (or anyone) can you give some link to info on "hg" > so i can study up on this topic ? http://mercurial.selenic.com/ -- Stanley C. Kitching Human Being Phoenix, Arizona -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite is quite SQL compliant

2010-10-02 Thread Cousin Stanley
Ravi wrote: > The documentation of the sqlite module > at http://docs.python.org/library/sqlite3.html > says: > > "... > allows accessing the database > using a nonstandard variant of the SQL..." > > But if you see SQLite website they clearly say > at http://sqlite.org/omitted.html that onl

Re: problem in Gasp !

2010-09-30 Thread Cousin Stanley
n.a.s wrote: > I want to ask about graphics using Gasp .Attached is exercise 10 > (houses at night) > > if i call the draw_house function once it will work properly ,but more than > one call,windows and doors disappear from some houses

Re: palindrome iteration

2010-09-13 Thread Cousin Stanley
> To deal with "real" palindromes such as, "Madam, I'm Adam," > you should probably strip all spaces and punctuation: > > # untested > pat = re.compile(r'[a-z]') > def is_palindrome(s): > letters = pat.findall(s.lower()) > return letters == reversed(letters) Using python 2.5 the above

Re: python styles: why Use spaces around arithmetic operators?

2010-07-30 Thread Cousin Stanley
> Parentheses are punctuation. Why not leave spaces around the commas as well, > to be consistent? > > myTuple = ( 1 , 2 , 3 , 4 , 5 ) Personally, I do use this particular style with commas as I find it more readable to my old and tired eyes Mandate m o r e whitespace :-)

Re: Getting pyparsing to backtrack

2010-07-07 Thread Cousin Stanley
> I'm working on street address parsing again, > and I'm trying to deal with some of the harder cases. > For yet another test case my actual address includes ... East South Mountain Avenue Sometimes written as ... E. South Mtn Ave -- Stanley C. Kitching Human Bei

Re: Another nntplib Question

2010-06-09 Thread Cousin Stanley
> > I've run into another snag with nntplib > Anthony For inspiration you might take a look at a nice news client written in python XPN (X Python Newsreader) is a graphical newsreader written in Python with the GTK+ toolkit. http://xpn.altervista.org/i

Re: PIL show() not working for 2nd pic

2010-01-09 Thread Cousin Stanley
> I am using PIL for image processing in ubuntu 9.04. When i give two > im.show() commands for two different images, the second image is not > displayed (eye of gnome is the display program). It says no such file > or directory. Any ideas? Suresh I also had problems with show() whe

Re: Dynamic text color

2010-01-03 Thread Cousin Stanley
> John Posner wrote > > I've posted a complete solution > > http://cl1p.net/jjp_dynamic_text_color/. John Thanks for posting your solution to Dave McCormick's query about colorizing text I was not familiar with the re.finditer method for search

Re: How do I correctly download Wikipedia pages?

2009-11-26 Thread Cousin Stanley
> I'm trying to scrape a Wikipedia page from Python. > On occasion I use a program under Debian Linux called wikipedia2text that is very handy for downloading wikipedia pages as plain text files Description: displays Wikipedia articles on the command line This scrip

Re: sys.stdout is not flushed

2009-11-23 Thread Cousin Stanley
>> >> You misunderstand what "flush" means. It is not about >> clearing the screen, or the line. >> >> Try printing >> >>    stdout.write('\r-->%d') >> >> Diez > > > But there is still a problem. When you use control character '\r', > you actually move to the head of the current buffer line

  1   2   >