Hey there,
i have tried about every graphing package for python i can get to work
on my system. gnuplot, pychart, biggles, gdchart, etc.. (cant get
matplot to work)
so far, they all are working ok. I need to make an x y chart for some
data that comes in from sensors at different times durring the
how ?
i have tried to use unix timestamps, and i have also tried with
DateTime objects
do i need to use a scale that isn't linear (default in most) ?
how do i putt this off ?
thanks btw.
sk
--
http://mail.python.org/mailman/listinfo/python-list
i have thought about doing this, just a little different. i was going
to list the value pairs.
take the start time and end time and plot 100 empty plots between them.
add the value pairs, sort by time, and then draw it. The only thing is
it get kinda complicated when the times change a lot. they
ok, yeah, thats exactly what i am looking for. i will give it a go.
thanks a whole lot.
putt this off is a typo, pull this off is what i was meaning to type.
this is cool.
--
http://mail.python.org/mailman/listinfo/python-list
ok, i tried something similar to what you posted.
a little simpler though.
i am running a query on a database and making a list of time, value
pairs
kinda like this
plot_points = ([time, value], [time, value], [time, value])
gnuplot complains that it needs a float for one of the values.
i can plot
the time is DateTime.DateTime object from a mySQLdb query.
the value is a number anywhere between 0 and 15.
the datetime is formatted like 2005-10-20 08:40:34
i could strip it and make a timestamp out of it. but reading the
number of seconds since january of 1970 doesn't make a neat chart.
any
ok, i have a display, and its a work in progress.
lemme get this straight. you used
gp('set term png')
is this an example of sending normal gnuplot commands?
if so, are all of the gnuplot commands available ?
thanks so much this is helping me out a lot here
--
this is great, because the docs on gnuplots website are a bit easier
for me to grasp.
thanks so much for your time on this one. you really have helped me a
lot.
i will not get a change to work on this till monday. so i may have more
questions then. This is sure a point in the right direction.
ok, i am stuck a bit here with this line
gp('set xtics (%s)' % ','.join(ticstrings))
the error code says that it is looking for a closing parenthesis.
that and i am kinda new enough not to really get what %s is all about.
i know it formats a string.
can you simply pass a list to 'set xtics' ?
well, for what i tried, ticstrings just contained a list of times
formatted like
[10-21 09:15, 10-21 09:44, 10-21 09:59, and so on.]
i did write mine a little different than the example that Grant gave me
because its a little
different application of time.
i think i am having trouble knowing
Ok, first off, thanks for all the help guys,
this part set xtics (label pos, label pos, label pos)
is mainly what i was confused about. the 'pos' part. i think that the
way i am writing
this leaves this out. in fact, i am pretty sure.
here is the code i am trying out.
def draw_chart(self,
tics.append('%s %s' % (time.strftime(...), x))
# might need time.localtime(x) for that last term.
ok, tried this and it worked.
but the first plot is at the last plot of data
back to that math mistake i mentioned earlier.
so, thanks much, i will be back when i mess around with it some
WE DID IT !
little more tinkering and correcting this
diff = start_time - end_time (vrs the other way around)
and its working.
so many thanks gents, a lot !
--
http://mail.python.org/mailman/listinfo/python-list
hey there all,
i have been looking for a way to run a php command line script from my
python script.
here is what i want to do:
if x = 4:
execute php4 testin.php
else:
execute php4 testout.php
and i also need the script to wait untill the php4 script is done
(which i think is the
man, thats just too easy.
thanks much !
--
http://mail.python.org/mailman/listinfo/python-list
well i know i dont want to do another thread, my program has six
running all the time.
whew. that can get nuts.
i mean, this will come to me easier later i am sure. But right now.
simple is best.
thanks for all the suggestions, gents.
right now i am just doing a varient of Steves suggestion,
hey there,
i have a small app that i am going to need to get information from a
few tables on different websites. i have looked at urllib and httplib.
the sites i need to get data from mostly have this data in tables. So
that, i think would make it easier. Anyone suggest a good starting
point for
yeah, i know i am going to have to write a bunch of stuff because the
values i want to get come from several different sites. ah-well, just
wanting to know the easiest way to learn how to get started. i will
check into beautiful soup, i think i have heard it referred to before.
thanks
shawn
--
hey there,
i am using beautiful soup to parse a few pages (screen scraping)
easy stuff.
the issue i am having is with one particular web page that uses a
javascript to display some numbers in tables.
now if i open the file in mozilla and save as i get the numbers in
the source. cool. but i click
thats cool, but i want to do this automatically with python.
what can i do to have urllib download the source with the numbers in
it?
ok, not necessarily urllib, whatever one is best for the occation
thanks
shawn
--
http://mail.python.org/mailman/listinfo/python-list
well, i think thats the case, looking at the code, there is a long
string of math functions in page, java math functions. h. i guess
i'm up that famous creek.
thanks for the info, though
shawn
--
http://mail.python.org/mailman/listinfo/python-list
Hey there,
i have a text file with a bunch of values scattered throughout it.
i am needing to pull out a value that is in parenthesis right after a
certain word,
like the first time the word 'foo' is found, retrieve the values in the
next set of parenthesis (bar) and it would return 'bar'
i think
this is cool, it is only going to run about 10 times a day,
the text is not written out like foo(bar) its more like
foo blah blah blah (bar)
the thing is , every few days the structure of the textfile may change,
one of the reasons i wanted to avoid the re.
thanks for the tip,
--
um, wait. what you are doing here is easier than what i was doing after
your first post.
thanks a lot. this is going to work out ok.
thanks again.
sk
--
http://mail.python.org/mailman/listinfo/python-list
hey there,
i have looked at the string module and re.
i was looking for advice on what would be the best way to pull a value
out of a small string.
for example, i have a string
$.+.09 JAR
and all i want out of it is the +.09
likewise, i have
$-.04 TIN kt
and all i want is the -.04
what
the second line was not a typo , and thanks for that.
these values may vary somewhat over time. So i may have to rewrite this
part of the script.
a string is fine for right now, because it is just going to be pumped
into a database. i can change it later if necessary.
thanks for the help gents,
I agree -- to each day are sufficient the evils thereof. Many
programmers fall into the temptation to overgeneralize and fail to
follow the AGNI principle (Ain't Gonna Need It...;-).
thats funny :)
--
http://mail.python.org/mailman/listinfo/python-list
heres the deal.
i am working on a threading gui. pygtk
in one class (main) is all the gui stuff,
but in another class that is a thread, i am reading serial input.
what i want to be able to do is take what read in the thread and
print it in a textview in the gui class.
here is what i have:
class
oh wait.
never mind , i figgured it out!
thanks anyway
--
http://mail.python.org/mailman/listinfo/python-list
Hey there,
i am doing a plotting application.
i am using mxRelativeDateTimeDiff to get how much time is between
date x and date y
now what i need to do is divide that time by 20 to get 20 even time
slots
for plotting on a graph.
For example, if the difference between them is 20 hours, i need 20
Hey there,
i am doing a plotting application.
i am using mxRelativeDateTimeDiff to get how much time is between
date x and date y
now what i need to do is divide that time by 20 to get 20 even time
slots
for plotting on a graph.
For example, if the difference between them is 20 hours, i need 20
sorry about that, i got a message in my inbox that said that the post
was rejected
so i tried it from my email client.
wont happen again.
shawn
--
http://mail.python.org/mailman/listinfo/python-list
hey,
a little update.
i got the pychart working
the examples did not include the necessary #!/usr/bin/python
its like being a literary critic forgetting how to spell his name.
thanks for your help getting the deb package going.
i should be all good now.
sk
--
Hey there pythoneers
i have another question about time, specifically, the mxDateTime
module.
i have been able to get a RelativeDateTimeDiff between two times,
it gives me a difference between two DateTimes in the form of +3days
+2hours etc...
so, if i have a date that is 6 days and 6 hours from
cool, thanks
-shawn
--
http://mail.python.org/mailman/listinfo/python-list
Hey there,
i am using the smtplib module in python 2.3
my question is, this works:
server = smtplib.SMTP(localhost)
then server.sendmail(to address, from address, message)
what i want to know is, how does the connection work?
when i do server.sendmail, does it connect then ? or did it
cool. so this line
server = smtplib.SMTP(localhost)
is when i connect ?
i had my syntax wrong anyway, i was using server.close()
instead of server.quit()
thanks much
--
http://mail.python.org/mailman/listinfo/python-list
thanks for all the help,
got it working ok now, connecting once, sending many.
thanks for the link too.
cheers,
sk
--
http://mail.python.org/mailman/listinfo/python-list
Hey there,
i have been spending some time learning python. i do enjoy it so.
Heres the deal. i need some dirrection advice.
i have a friend that wants me to set up a customer database for him.
Easy stuff like name, phone number, email address. and current status.
he also wants to be able to print
wow thanks,
i think i am going to check out sqlite.
acce$$ is not possible because of the cash. ick.
i am interested in learning the code anyway, but just want to learn
python instead of
javascript right now.
i have a simple cgi-script working to display info to the browser (from
apache)
but the
Hey there.
i want to set a variable to represent the last line of a text file
how do i do that?
or even better, how do i create a list of the lines of a text file?
--
http://mail.python.org/mailman/listinfo/python-list
cool. thanks for the help guys !
--
http://mail.python.org/mailman/listinfo/python-list
Hey there,
i am trying to write an online application using the cgi module.
what i want to do is have an html form display a drop-down list and
have the values of that list be the lines of text written in a file.
this would be updated almost every time the site is visited.
i have been sucessful in
Hey man, i would like to know this too.
hope someone knows...
--
http://mail.python.org/mailman/listinfo/python-list
whoa, thanks
been trying to figgure this out for a week.
cant wait to try it this weekend.
thanks again.
--
http://mail.python.org/mailman/listinfo/python-list
Hello all.
i have a strange problem with some python cgi scripts.
the deal is.
i keep loosing permission to write to a file created by a cgi script.
the file is created in a directory created by a python script. but
after the file is created by the cgi script,
another script in the same
Hey there. Here is the deal i have a script that is supposed to
open a file based on criteria from a web form.
i cant seem to get it to work though.
here is the code:
form = cgi.FieldStorage()
DataRecord = form['DataTime'].value
Customer = form['CustName'].value # should be automatically
no takers?
--
http://mail.python.org/mailman/listinfo/python-list
i fixed it.
the program was going nuts because there were
spaces in the name of the file.
go figgure.
anyway, i changed the way i format the timestamp that
becomes the file name and removed the spaces.
working all better now.
thanks
--
http://mail.python.org/mailman/listinfo/python-list
Hey there,
i have a python cgi script that prints out html just fine in the Opera
browser
but doesnt print at all under FireFox.
weird, eh?
i am getting nothing in the apache logs about any error.
perhaps its a firefox issue, but i doubt it.
any suggestions. simple script here..
--
Well, i don't have an app that will automaticlly check a page for
errors,
unless bluefish will do it, i am not sure.
the page it is supposed to print out is a response to a form entry.
here is the source from Opera if one of you guys want to look at it.
html
headtitleCustomer Data/title/head
Ok, i made a change in the source. now here is the source from Opera,
still cant get firefox to work with me.
html
headtitleCustomer Data/title/head
body
h1Watkins Crop Consulting/h1
/body
1915 Cherokee br
Dalhart, Tx 79022 br 333-5943br
H3gandalf/H3
span style='font-weight:
fixed, thanks for all of your help.
i am pouring over python texts and the problem is
html... duh
looking for a more efficient way to jerk all of the hair outta my head.
thanks a whole lot. your awesome
--
http://mail.python.org/mailman/listinfo/python-list
Great Advice, can see that saving me a few headaches
thanks
--
http://mail.python.org/mailman/listinfo/python-list
i have an html form with a drop-down list that lists a bunch of images.
how can i get my cgi script to load the image ?
i have imported cgi and os
text entered from a form and read from a file do ok, but i cant seem to
get it to load an image.
the form writes all of the entries as lines in a .txt
hey there,
i have a script that retrieves my email, but i need it to
be able to strip all the stuff off except the body (the message itself)
so i can later write it to a text file.
anyone know how to accomplish this?
thanks
--
http://mail.python.org/mailman/listinfo/python-list
Hey there all,
i have a question about how to point my python install to my sql database.
when i enter this: db = MySQLdb.connect(user=user, passwd=pass,
db=myDB)
i get this:
Traceback (most recent call last):
File pyshell#1, line 1, in -toplevel-
db = MySQLdb.connect(user=user,
Hey there all,
i have a question about how to point my python install to my sql
database.
when i enter this: db = MySQLdb.connect(user=user, passwd=pass,
db=myDB)
i get this:
Traceback (most recent call last):
File pyshell#1, line 1, in -toplevel-
db = MySQLdb.connect(user=user,
hey there,
i need to be able to get the index for an item in a list.
the list is a list of lines read from a text file.
like this:
file = open(/home/somefile.text, r)
lines = file.readlines()
file.close()
now, i want to see if a certain string is == to one of the lines
and if so, i need to know
Hey, thanks, this has worked out for me.
i am trying to do as much of this as possible in IDLE because
it lets me know on the fly what is messed up.
thanks for your help
shawn
--
http://mail.python.org/mailman/listinfo/python-list
Hey there,
kinda newbie question here.
i know how to read the lines of a txt file.
i know how to write a txt file.
but how do i overwrite a line value with another value ?
i mean, how do go to, say, line 3 of a text file and replace
what is written on line 3 with something else?
thanks
--
Gee whiz, so easy.
thanks. Never thought about just changing it while it was read then
re-writing it. that will be just fine. these files are only 9 lines
long.
thanks again !
--
http://mail.python.org/mailman/listinfo/python-list
Hey there, does anyone know where i can find some real documentation on
the MySQLdb module? This thing is driving me nuts. all i can find on
the internet is some brief tutorials. I need to know whats up with some
of my stuff i even bought Programming Python by O'Reilly, out of over
1200 pages, and
Wow, thanks so much. I promise, i didn't know that was out there.
should help me out a lot.
still a newbie here, somewhat.
thanks again
--
http://mail.python.org/mailman/listinfo/python-list
Hey there,
sorry , second question in as many days.
i am trying to do some stuff with MySQLdb and the thing is, i can
select records and such, but when i try to delete them, they dont
really go away.
like this
cursor.execute(DELETE FROM table WHERE autoinc 1000)
240L
cursor.execute(SELECT *
Simon Brunning wrote:
On 27 Jul 2005 04:29:33 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hey there,
sorry , second question in as many days.
i am trying to do some stuff with MySQLdb and the thing is, i can
select records and such, but when i try to delete them, they dont
really go
ok. did this
cursor.execute(DELETE FROM table WHERE autoinc 1000)
245L
cursor.commit()
i got an AttributeError 'Cursor' object has no attribute 'commit'
hmm. what should i do now?
the stuff about writing a lightweight layer between the dbapi and the
program shot right over my head. sorry,
Man, thanks for the link. and the tip. i am testing
the db.commit() and printing the doc right now.
thanks again.
On 07/27/2005 07:43:24 AM, Rowdy wrote:
[EMAIL PROTECTED] wrote:
ok. did this
cursor.execute(DELETE FROM table WHERE autoinc 1000)
245L
cursor.commit()
i got an
Hullo all !
i have a real easy one here that isn't in my book.
i have a int number that i want to divide by 100 and display to two
decimal places.
like this float(int(Var)/100)
but i need it to display the .00 even if it does not have a .00 value
like this
if Var is 50, i need to display .50
way cool, outta work out just fine
On 07/28/2005 08:48:27 AM, Simon Brunning wrote:
On 28 Jul 2005 06:39:32 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
i have a real easy one here that isn't in my book.
i have a int number that i want to divide by 100 and display to two
decimal
oops, i dont seem to have a module decimal
-shawn
On 07/28/2005 08:48:27 AM, Simon Brunning wrote:
On 28 Jul 2005 06:39:32 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
i have a real easy one here that isn't in my book.
i have a int number that i want to divide by 100 and display to two
Hey there,
i have a simple database query that returns as a tuple the number of
rows that the query selected.
kinda like this
cursor.execute('select value from table where autoinc 234')
x = cursor.fetchall()
print x
21L
ok, means 21 rows met the criteria of the query. but if there are none
ok, this is what works:
if x == ():
sorry about the bad info. and what i ment to put was
x[0] not x(0)
thanks for the tips
its all good now
shawn
Steven D'Aprano wrote:
On Sun, 31 Jul 2005 08:40:26 -0700, nephish wrote:
Hey there,
i have a simple database query that returns as a tuple
i have an interesting project at work going on. here is the challenge.
i am using the serial module to read data from a serial input.
it comes in as a hex. i need to make it a binary and compare it bit by
bit to another byte. They have some weird way they set this up that i
have to compare these
yeah, i think i got that down, i need help with getting the hex to
binary, then splitting the byte up to compare each bit against the bit
in another byte.
unless i am not understanding this stuff with the bitwise right. there
wasn't a lot in the python library reference about it.
thanks
--
this is exactly what i need.
i have not previously had a need for this kind of thing, but i sure
need some
documentation for it now. is there a resource out there to find out how
to convert decimal number to a byte, a byte to a decimal and more about
the operator?
i really appreciate this info.
oh wait, i found it. i found how to do the conversions and thanks to
you the operators.
appreciate everything,
shawn
--
http://mail.python.org/mailman/listinfo/python-list
i got the bitwise part, i just cant seem to convert the incomming ascii
into hex, binary, integer, or decimal.
how do i do this, my serial port bytes just come in all weird looking
ascii characters
thanks
--
http://mail.python.org/mailman/listinfo/python-list
i have an ascii string comming in the serial port and i need to convert
it to something else, like an integer, or binary, or even a hex so i
can use the bitwise comparison on it.
thanks
--
http://mail.python.org/mailman/listinfo/python-list
import serial
ser = serial.Serial('/dev/ttyS0', 2400, timeout= 10, bytesize=8, stopbits=1)
a = ser.read(1)
print a
^
ser.close()
type(a)
type 'str'
int(a, 16)
Traceback (innermost last):
File stdin, line 1, in ?
ValueError: invalid literal for int(): ^
so i run it again the same way,
all apologies, gentlemen, i feel like an idiot.
the ord() is what is returning what i need.
the manufacturer of the unit i am reading from
told me that it puts out a string that represents a hex
been thumping my head.
sorry for the confusion,
and thanks for your help
shawn
--
thanks for your time.
i have started just doing a type(a) from idle a lot just so i can make
sure of what i am dealing with ( i do this a lot) before i build the
.py file. got tired of 'cannot concatonate str and init' stuff all the
time.
this has been a wild project. nothing like getting in way
Sorry i am late getting back on this.
ord() is finally what is giving me what i wanted.
the vendor told me that what was comming in was an ascii string
representing hex characters. So i expected when i used the serial
module
that what i would be getting was something along the lines of 4A, 3D,
Hey there.
i have a time string (created with strftime) then read from a file,
i am having some trouble understanding how to get the difference
between times.
i know i can structime(timestring) and get a time value, but i dont
know how to manipulate it.
basically, if i have string 2005-08-24
the mxDateTime thing should be great, i have to pass this stuff back
and forth with MySQL DateTime fields,
thanks a lot !
--
http://mail.python.org/mailman/listinfo/python-list
Hey there,
could someone show me where i am going wrong here?
date1 = '2005-01-01 8:20:00'
date1 = strptime('%Y-%m-%d %H:%M:%S',date1)
raise ValueError(time data did not match format: data=%s fmt=%s %
ValueError: time data did not match format: data=%Y-%m-%d%H:%M:%S
fmt=2005-01-01 8:20:00
OH my god.
youre right.
i feel like a complete idiot.
thanks
--
http://mail.python.org/mailman/listinfo/python-list
he he. yep, just spent a lot of time on this one.
life moves on.
cheers!
sk
--
http://mail.python.org/mailman/listinfo/python-list
Hello there,
i need a way to check to see if a certain value can be an integer. I
have looked at is int(), but what is comming out is a string that may
be an integer. i mean, it will be formatted as a string, but i need to
know if it is possible to be expressed as an integer.
like this
var =
thanks for the reply, but wont python fail out if you try to make an
integer out of what cant be an integer?
like this :
var = int(abc)
wont this crash ?
--
http://mail.python.org/mailman/listinfo/python-list
this looks like the solution i am looking for. thanks for the education
by the way.
i have a couple of other try / except clauses. Never thought of pulling
it off like that.
thanks very much, really simple.
--
http://mail.python.org/mailman/listinfo/python-list
it isn't really that i will want to change it to an integer anyway. the
script uses a table to reference a value to a key, if the key is a
group of letters, that code tells the script to do something. if the
value is a number, it means an equipment failure. The thing is, all the
values come out as
Hello there,
i need to write a script that can transfer info back and forth with a
data server at so-and-so ip.
i have Programming Python, which covers socket programming. So thats
cool. But what i need to know how to do is make a message in ascii that
is what the server is looking for.
for
Thanks guys,
No, i did not know about isdigit ?
very helpful. Thanks.
esp liked the overloaded doohicky' bit.
thanks again.
--
http://mail.python.org/mailman/listinfo/python-list
i think like byte 1 = 'S'
byte 2 = 'T'
and byte 3 = 'X'
still new at this, and thanks for the references
-sk
--
http://mail.python.org/mailman/listinfo/python-list
ok, part of what i have to do is know how many bytes will be sent. in
ascii is it one byte per character ?
like password would be 8 bytes long?
--
http://mail.python.org/mailman/listinfo/python-list
i know that those characters exist, the docs say that the server does
not want the special ETX and STX characters, but the 3 ascii
characters STX and ENX i am not sure why.
--
http://mail.python.org/mailman/listinfo/python-list
i'm not sure, but its kinda been a pain in the hinder for a newbie like
me to find it in their docs.
thanks for all the help guys, let you know how it goes
--
http://mail.python.org/mailman/listinfo/python-list
ok, i am stuck again.
from the docs, the byte stream is supposed to look like this:
'S' 'T' 'X' [length indicator] [message type] [message] 'E' 'N' 'X'
the length indicator it says is a four byte integer number of a value N
( N would be how long the message body is )
the message type comes
indeed i did not. thanks for the tip.
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 149 matches
Mail list logo