need some advice on x y plot

2005-10-20 Thread nephish
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

Re: need some advice on x y plot

2005-10-20 Thread nephish
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

Re: need some advice on x y plot

2005-10-20 Thread nephish
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

Re: need some advice on x y plot

2005-10-20 Thread nephish
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

Re: need some advice on x y plot

2005-10-21 Thread nephish
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

Re: need some advice on x y plot

2005-10-21 Thread nephish
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

Re: need some advice on x y plot

2005-10-21 Thread nephish
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 --

Re: need some advice on x y plot

2005-10-21 Thread nephish
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.

Re: need some advice on x y plot

2005-10-24 Thread nephish
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' ?

Re: need some advice on x y plot

2005-10-25 Thread nephish
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

Re: need some advice on x y plot

2005-10-25 Thread nephish
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,

Re: need some advice on x y plot

2005-10-25 Thread nephish
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

Re: need some advice on x y plot

2005-10-25 Thread nephish
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

how do i run another script from my python script

2005-10-27 Thread nephish
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

Re: how do i run another script from my python script

2005-10-27 Thread nephish
man, thats just too easy. thanks much ! -- http://mail.python.org/mailman/listinfo/python-list

Re: how do i run another script from my python script

2005-10-27 Thread nephish
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,

need start point for getting html info from web

2005-10-30 Thread nephish
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

Re: need start point for getting html info from web

2005-10-30 Thread nephish
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 --

question about urllib and parsing a page

2005-11-02 Thread nephish
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

Re: question about urllib and parsing a page

2005-11-02 Thread nephish
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

Re: question about urllib and parsing a page

2005-11-02 Thread nephish
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

need help extracting data from a text file

2005-11-07 Thread nephish
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

Re: need help extracting data from a text file

2005-11-07 Thread nephish
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, --

Re: need help extracting data from a text file

2005-11-07 Thread nephish
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

question about extracting value from a string

2005-12-07 Thread nephish
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

Re: question about extracting value from a string

2005-12-07 Thread nephish
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,

Re: question about extracting value from a string

2005-12-07 Thread nephish
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

can i move attribute values from one class to another?

2005-09-07 Thread nephish
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

Re: can i move attribute values from one class to another?

2005-09-07 Thread nephish
oh wait. never mind , i figgured it out! thanks anyway -- http://mail.python.org/mailman/listinfo/python-list

need to divide a date

2005-09-22 Thread nephish
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

time challenge

2005-09-22 Thread nephish
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

Re: time challenge

2005-09-23 Thread nephish
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

never mind about the plot stuff, my mistake

2005-09-26 Thread nephish
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 --

another time challenge

2005-09-28 Thread nephish
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

Re: another time challenge

2005-09-29 Thread nephish
cool, thanks -shawn -- http://mail.python.org/mailman/listinfo/python-list

question about smtplib

2005-10-03 Thread nephish
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

Re: question about smtplib

2005-10-03 Thread nephish
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

Re: question about smtplib

2005-10-04 Thread nephish
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

dirrection for simple record keeping app.

2005-05-26 Thread nephish
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

Re: dirrection for simple record keeping app.

2005-05-26 Thread nephish
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

How do i read just the last line of a text file?

2005-05-28 Thread nephish
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

Re: How do i read just the last line of a text file?

2005-05-29 Thread nephish
cool. thanks for the help guys ! -- http://mail.python.org/mailman/listinfo/python-list

cgi help

2005-05-31 Thread nephish
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

Re: Rss lib in python?

2005-05-31 Thread nephish
Hey man, i would like to know this too. hope someone knows... -- http://mail.python.org/mailman/listinfo/python-list

Re: cgi help

2005-06-01 Thread nephish
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

weird cgi problem w/ apache

2005-06-03 Thread nephish
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

need some cgi help please

2005-06-07 Thread nephish
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

Re: need some cgi help please

2005-06-08 Thread nephish
no takers? -- http://mail.python.org/mailman/listinfo/python-list

Re: need some cgi help please

2005-06-08 Thread nephish
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

cgi script runs under Opera, but not firefox

2005-06-11 Thread nephish
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.. --

Re: cgi script runs under Opera, but not firefox

2005-06-11 Thread nephish
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

Re: cgi script runs under Opera, but not firefox

2005-06-11 Thread nephish
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:

Re: cgi script runs under Opera, but not firefox

2005-06-11 Thread nephish
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

Re: cgi script runs under Opera, but not firefox

2005-06-11 Thread nephish
Great Advice, can see that saving me a few headaches thanks -- http://mail.python.org/mailman/listinfo/python-list

stuck in cgi-image mess

2005-06-13 Thread nephish
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

need to strip stuff off email

2005-06-21 Thread nephish
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

some trouble with MySQLdb

2005-06-29 Thread nephish
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,

need help with MySQLdb

2005-06-29 Thread nephish
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,

need to get an index for an item in a list

2005-07-03 Thread nephish
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

Re: need to get an index for an item in a list

2005-07-03 Thread nephish
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

how to write a line in a text file

2005-07-25 Thread nephish
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 --

Re: how to write a line in a text file

2005-07-25 Thread nephish
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

need some info on MySQL module.

2005-07-26 Thread nephish
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

Re: need some info on MySQL module.

2005-07-26 Thread nephish
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

question about deleting records from mysql

2005-07-27 Thread nephish
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 *

Re: question about deleting records from mysql

2005-07-27 Thread nephish
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

Re: question about deleting records from mysql

2005-07-27 Thread nephish
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,

Re: question about deleting records from mysql

2005-07-27 Thread nephish
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

easy float question just eludes me

2005-07-28 Thread nephish
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

Re: easy float question just eludes me

2005-07-28 Thread nephish
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

Re: easy float question just eludes me

2005-07-28 Thread nephish
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

getting an empty tuple

2005-07-31 Thread nephish
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

Re: getting an empty tuple

2005-07-31 Thread nephish
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

question about binary and serial info

2005-08-17 Thread nephish
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

Re: question about binary and serial info

2005-08-17 Thread nephish
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 --

Re: question about binary and serial info

2005-08-18 Thread nephish
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.

Re: question about binary and serial info

2005-08-18 Thread nephish
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

Re: question about binary and serial info

2005-08-18 Thread nephish
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

Re: question about binary and serial info

2005-08-18 Thread nephish
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

Re: question about binary and serial info

2005-08-18 Thread nephish
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,

Re: question about binary and serial info

2005-08-18 Thread nephish
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 --

Re: question about binary and serial info

2005-08-18 Thread nephish
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

Re: question about binary and serial info

2005-08-21 Thread nephish
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,

need a little help with time

2005-08-26 Thread nephish
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

Re: need a little help with time

2005-08-26 Thread nephish
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

trouble with time --again

2005-08-30 Thread nephish
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

Re: trouble with time --again

2005-08-30 Thread nephish
OH my god. youre right. i feel like a complete idiot. thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: trouble with time --again

2005-08-30 Thread nephish
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

check to see if value can be an integer instead of string

2006-01-17 Thread nephish
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 =

Re: check to see if value can be an integer instead of string

2006-01-17 Thread nephish
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

Re: check to see if value can be an integer instead of string

2006-01-17 Thread nephish
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

Re: check to see if value can be an integer instead of string

2006-01-18 Thread nephish
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

in over my head ascii

2006-02-06 Thread nephish
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

Re: check to see if value can be an integer instead of string

2006-02-06 Thread nephish
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

Re: in over my head ascii

2006-02-06 Thread nephish
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

Re: in over my head ascii

2006-02-06 Thread nephish
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

Re: in over my head ascii

2006-02-06 Thread nephish
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

Re: in over my head ascii

2006-02-07 Thread nephish
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

Re: in over my head ascii

2006-02-07 Thread nephish
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

Re: in over my head ascii

2006-02-07 Thread nephish
indeed i did not. thanks for the tip. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >