Re: New to Python, Help to get script working?

2013-12-16 Thread Mark
On Monday, December 16, 2013 2:52:05 AM UTC-5, Mark wrote: > On Monday, December 16, 2013 2:48:56 AM UTC-5, Mark wrote: > > > On Monday, December 16, 2013 2:43:45 AM UTC-5, Mark wrote: > > > > > > > On Monday, December 16, 2013 2:09:38 AM UTC-5, Mark wrote: > > > > > > > > > > > > > > >

Re: Need Help with the BeautifulSoup problem, please

2013-12-16 Thread 88888 Dihedral
On Monday, December 16, 2013 2:41:08 PM UTC+8, seas...@gmail.com wrote: > I need to replace all tag with after ■. But the result from below > is '■ D / ' > > Can you explain what I did wrong, please. > > > > s = '■A B C D / ' > > soup = BeautifulSoup(s) > > for i in soup.find

Re: New to Python, Help to get script working?

2013-12-16 Thread Mark
On Monday, December 16, 2013 2:55:23 AM UTC-5, Mark wrote: > On Monday, December 16, 2013 2:52:05 AM UTC-5, Mark wrote: > > > On Monday, December 16, 2013 2:48:56 AM UTC-5, Mark wrote: > > > > > > > On Monday, December 16, 2013 2:43:45 AM UTC-5, Mark wrote: > > > > > > > > > > > > > > >

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Jeremy Sanders
Michael Torrie wrote: > I think PyQt is slowly being pushed aside in favor of PySide, which is > more license-friendly for use in closed or open projects. I would > recommend using PySide unless PyQt is a requirement for your project. That's not the impression I get from the PySide mailing lists

Re: New to Python, Help to get script working?

2013-12-16 Thread Frank Millman
"Mark" wrote in message news:4c2822b4-d95c-4735-af12-55ac5ff2f...@googlegroups.com... > On Monday, December 16, 2013 2:55:23 AM UTC-5, Mark wrote: > > If i just try to double click the script, i get an index error, i can > barely see the window it disappears so fast, but thats what I see. I ha

Re: Need Help with the BeautifulSoup problem, please

2013-12-16 Thread seaspeak
seas...@gmail.com於 2013年12月16日星期一UTC+8下午2時41分08秒寫道: > I need to replace all tag with after ■. But the result from below > is '■ D / ' > > Can you explain what I did wrong, please. > > > > s = '■A B C D / ' > > soup = BeautifulSoup(s) > > for i in soup.find_all(text='■'): > >

Re: Wrapping around a list in Python.

2013-12-16 Thread Peter Otten
shengjie.sheng...@live.com wrote: > The idea is to grab the last 4 elements of the array. However i have an > array that contains a few hundred elements in it. And the values continues > to .append over time. How would i be able to display the last 4 elements > of the array under such a condition?

Re: Comparing values of counter in python 3.3

2013-12-16 Thread Mark Lawrence
On 16/12/2013 02:40, Roy Smith wrote: In article <905d6e7e-6748-42dd-8b63-d80a4d175...@googlegroups.com>, rusi wrote: On Monday, December 16, 2013 7:29:31 AM UTC+5:30, alex23 wrote: # Need to compare values of counter and reject in function/routine in value in counter2 is higher then value

Re: New to Python, Help to get script working?

2013-12-16 Thread Mark Lawrence
On 16/12/2013 08:02, Mark wrote: The record for double spaced google crap, congratulations. Mind you, it's a great new game this, Spot the Text, much better than I Spy!!! On Monday, December 16, 2013 2:55:23 AM UTC-5, Mark wrote: On Monday, December 16, 2013 2:52:05 AM UTC-5, Mark wrote:

Re: Need Help with the BeautifulSoup problem, please

2013-12-16 Thread Andreas Perstinger
On 16.12.2013 07:41, seasp...@gmail.com wrote: I need to replace all tag with after ■. But the result frombelow is '■ D / ' Can you explain what I did wrong, please. s = '■A B C D / ' soup = BeautifulSoup(s) for i in soup.find_all(text='■'): tag = soup.new_tag('span')

Re: Need Help with the BeautifulSoup problem, please

2013-12-16 Thread seaspeak
8 Dihedral於 2013年12月16日星期一UTC+8下午4時02分42秒寫道: > On Monday, December 16, 2013 2:41:08 PM UTC+8, seas...@gmail.com wrote: > > > I need to replace all tag with after ■. But the result from > > below is '■ D / ' > > > > > > Can you explain what I did wrong, please. > > > > > > > > > >

Re: Need Help with the BeautifulSoup problem, please

2013-12-16 Thread Peter Otten
seasp...@gmail.com wrote: > I need to replace all tag with after ■. But the result from > below is '■ D / ' > Can you explain what I did wrong, please. > > s = '■A B C D / ' > soup = BeautifulSoup(s) > for i in soup.find_all(text='■'): > tag = soup.new_tag('span')

Re: Wrapping around a list in Python.

2013-12-16 Thread Mark Lawrence
On 16/12/2013 05:10, shengjie.sheng...@live.com wrote: On Monday, 16 December 2013 13:07:46 UTC+8, shengjie...@live.com wrote: Would you please read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing, thanks. -- My fellow Pythonistas, a

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Mark Lawrence
On 16/12/2013 05:08, Chris Angelico wrote: On Mon, Dec 16, 2013 at 3:51 PM, Michael Torrie wrote: I think Python is a great overall application development language, especially for the GUI. First-class functions for callbacks make it very nice compared to other languages. Python is fast enou

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean Dubois
Op donderdag 12 december 2013 22:23:22 UTC+1 schreef Dan Stromberg: > On Thu, Dec 12, 2013 at 12:28 AM, Jean Dubois wrote: > > On Thursday, December 12, 2013 12:20:36 AM UTC+1, Dan Stromberg wrote: > >> On Wed, Dec 11, 2013 at 3:08 PM, Jean Dubois wrote: > >> > >> I have an ethernet-rs232 adapter

Re: Comparing values of counter in python 3.3

2013-12-16 Thread Devin Jeanpierre
On Sun, Dec 15, 2013 at 6:32 PM, rusi wrote: > On Monday, December 16, 2013 7:29:31 AM UTC+5:30, alex23 wrote: >> > # Need to compare values of counter and reject in function/routine in >> > value in counter2 is higher then value in counter1 for a current key > >> [(k,Counter2[k]) for k in C

Re: Want guidance to set proxy please help

2013-12-16 Thread Denis McMahon
On Sun, 15 Dec 2013 20:29:55 -0800, Jai wrote: > so , i need some step to set proxy so that my ip is not blocked by them This sounds like you're attempting to access a site other than for legitimate purposes. You probably want some 1337 script kiddies forum, not a serious programming newsgroup

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Ervin Hegedüs
hello, > #!/usr/bin/env python > > """ > A simple echo client > """ > import socket as socket_mod > import bufsock as bufsock_mod [...] > Traceback (most recent call last): > File "./buftest.py", line 11, in > socket = socket_mod.socket(socket.AF_INET, socket.SOCK_STREAM) > NameError: name

Re: Wrapping around a list in Python.

2013-12-16 Thread Denis McMahon
On Mon, 16 Dec 2013 15:59:32 +1100, Ben Finney wrote: > shengjie.sheng...@live.com writes: > >> Hi guys, I am trying to create a fixed list which would allow my values >> to be wrapped around it. > > This doesn't make a lot of sense to me, but I assume you have a purpose > in mind for this. What

Launching Helium: A Selenium wrapper that makes web automation 50% easier

2013-12-16 Thread Michael Herrmann
Hi everyone, I'm working for a startup called BugFree Software and would like to announce that today we're launching our second product! Helium is a library that wraps around Selenium to simplify web automation. It does away with many of the technicalities involved with web scripting. For exam

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
> > Such equipment often implements a telnet protocol. Have use try > > using the telnetlib module ? > > http://docs.python.org/2/library/telnetlib.html > > > > t = Telnet(host, port) > > t.write('*IDN?') > > print t.read_until('Whateverprompt') > > # you can use read_very_eager also > > > > JM > >

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
> Did you try > > import telnetlib > > ? > > Note that in the code above I forgot the EOF, which is very much > dependent of the equipment itself. > > You may have to write > t.write('*IDN?\n') > or > t.write('IDN?\n\r') > > JM Additionally, here's the code we're using for our signal generat

Python, mySQL and password

2013-12-16 Thread Igor Korot
Hi, ALL, Is there a way to make python script that connects to mySQL DB ask for a password on the: conn = mdb.connect(host, user) line. The host variable is "localhost" and the user variable is "root" (for developmental purposes). Thank you. -- https://mail.python.org/mailman/listinfo/python-li

Re: Python, mySQL and password

2013-12-16 Thread Ervin Hegedüs
Hello, On Mon, Dec 16, 2013 at 02:55:29AM -0800, Igor Korot wrote: > Hi, ALL, > Is there a way to make python script that connects to mySQL DB ask for > a password on the: > > conn = mdb.connect(host, user) > > line. > The host variable is "localhost" and the user variable is "root" (for > devel

Packaging a private project

2013-12-16 Thread Nicholas Cole
Dear List, What is the best way to distribute a private, pure python, Python 3 project that needs several modules (some available on pypi but some private and used by several separate projects) in order to run? I'd like to include everything that my project needs to run in a single package. The

Re: Python, mySQL and password

2013-12-16 Thread Peter Otten
Ervin Hegedüs wrote: > Hello, > > On Mon, Dec 16, 2013 at 02:55:29AM -0800, Igor Korot wrote: >> Hi, ALL, >> Is there a way to make python script that connects to mySQL DB ask for >> a password on the: >> >> conn = mdb.connect(host, user) >> >> line. >> The host variable is "localhost" and the

Re: Launching Helium: A Selenium wrapper that makes web automation 50% easier

2013-12-16 Thread Larry Martell
On Mon, Dec 16, 2013 at 5:17 AM, Michael Herrmann wrote: > Hi everyone, > > I'm working for a startup called BugFree Software and would like to announce > that today we're launching our second product! > > Helium is a library that wraps around Selenium to simplify web automation. It > does away

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean Dubois
Op maandag 16 december 2013 11:29:12 UTC+1 schreef Jean-Michel Pichavant: > > > Such equipment often implements a telnet protocol. Have use try > > > using the telnetlib module ? > > > http://docs.python.org/2/library/telnetlib.html > > > > > > t = Telnet(host, port) > > > t.write('*IDN?') > > > pr

Re: Python, mySQL and password

2013-12-16 Thread Ervin Hegedüs
Hello Peter, On Mon, Dec 16, 2013 at 12:38:33PM +0100, Peter Otten wrote: > Ervin Hegedüs wrote: > > > dsn['passwd'] = raw_input("Enter password for %s: " % (dsn['user'])) > > [...] > > but at this way the password what you type will showing! > > To avoid that use getpass.getpass() instead of

Question RE urllib

2013-12-16 Thread Jeff James
So I'm using the following script to check our sites to make sure they are all up and some of them are reporting they are "down" when, in fact, they are actually up. These sites do not require a logon in order for the home page to come up. Could this be due to some port being blocked internally

Re: Question RE urllib

2013-12-16 Thread Larry Martell
On Mon, Dec 16, 2013 at 6:40 AM, Jeff James wrote: > So I'm using the following script to check our sites to make sure they are > all up and some of them are reporting they are "down" when, in fact, they > are actually up. These sites do not require a logon in order for the home > page to come u

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Chris Angelico
On Mon, Dec 16, 2013 at 8:42 PM, Mark Lawrence wrote: > I've done the latter, but still can't fit all the data for my 100+ screens > into a one liner, help please :) With 100 screens, you should be able to use lines of text up to 8000 characters long - just make sure your screens are organized ho

Re: Question RE urllib

2013-12-16 Thread Tim Chase
On 2013-12-16 04:40, Jeff James wrote: > These sites do not require a logon in order for the home > page to come up. Could this be due to some port being blocked > internally ? Only one of the sites reporting as down is "https" but > all are internal sites. Is there some other component I should

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
> Here is the code: > #!/usr/bin/env python > import telnetlib > host = '10.128.59.63' > port = 7000 > t = Telnet(host, port) > t.write('*IDN?\n') > print t.read_until('Whateverprompt') > # you can use read_very_eager also > > and this is the result of executing the code(from which I deduce I > ha

Re: min max from tuples in list

2013-12-16 Thread Chris Angelico
On Sun, Dec 15, 2013 at 2:41 PM, Tim Roberts wrote: > Dennis Lee Bieber wrote: >> >>> >>>Well "performant" is performant enough for the purposes of communicating >>>on the python list I think :D >> >> Most probably could figure it out as being stylistically similar to >>"conformant", which

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread 88888 Dihedral
On Friday, December 13, 2013 5:58:49 AM UTC+8, Chris Angelico wrote: > On Fri, Dec 13, 2013 at 8:27 AM, Dan Stromberg wrote: > > > On Thu, Dec 12, 2013 at 6:16 AM, Grant Edwards > > wrote: > > > > > >>> Sockets reserve the right to split one socket.send() into multiple > > >>> socket.recv()'

Re: Wrapping around a list in Python.

2013-12-16 Thread David Robinow
On Mon, Dec 16, 2013 at 12:26 AM, wrote: > The idea is to grab the last 4 elements of the array. However i have an array > that contains a few hundred elements in it. And the values continues to > .append over time. How would i be able to display the last 4 elements of the > array under such a

Re: Wrapping around a list in Python.

2013-12-16 Thread Dave Angel
On Sun, 15 Dec 2013 21:26:49 -0800 (PST), shengjie.sheng...@live.com wrote: The idea is to grab the last 4 elements of the array. However i have an array that contains a few hundred elements in it. And the values continues to .append over time. How would i be able to display the last 4 elements

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Chris Angelico
On Mon, Dec 16, 2013 at 11:38 PM, 8 Dihedral wrote: > It is trivial to use UDP with > forward error correction such as > the CD in 1982. This is another reason for moving to IPv6. With IPv4, the size of a datagram is limited to 64KB, but with IPv6, you could carry an entire CD's contents in a

Re: Question Re urllib (Jeff James)

2013-12-16 Thread Jeff James
I'm not really receiving an "exception" other than those three sites, out of the 30 or so I have listed, are the only sites which show "is down" at the end of that line specifying the site. Where " # " has been substituted for our domain name https://my..com/intranet.html* is down* ht

Re: Launching Helium: A Selenium wrapper that makes web automation 50% easier

2013-12-16 Thread Michael Herrmann
On Monday, December 16, 2013 12:40:56 PM UTC+1, larry@gmail.com wrote: ... > Is this open source? No. We quit our daytime jobs to work on this project and need the income to sustain our development... -- https://mail.python.org/mailman/listinfo/python-list

Re: Question Re urllib (Jeff James)

2013-12-16 Thread Larry Martell
On Monday, December 16, 2013, Jeff James wrote: > I'm not really receiving an "exception" other than those three sites, out > of the 30 or so I have listed, are the only sites which show "is down" at > the end of that line specifying the site. > > > Where " # " has been substituted for our domain

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean Dubois
Op maandag 16 december 2013 13:05:41 UTC+1 schreef Jean-Michel Pichavant: > > Here is the code: > > #!/usr/bin/env python > > import telnetlib > > host = '10.128.59.63' > > port = 7000 > > t = Telnet(host, port) > > t.write('*IDN?\n') > > print t.read_until('Whateverprompt') > > # you can use read_

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Mark Lawrence
On 16/12/2013 11:58, Chris Angelico wrote: On Mon, Dec 16, 2013 at 8:42 PM, Mark Lawrence wrote: I've done the latter, but still can't fit all the data for my 100+ screens into a one liner, help please :) With 100 screens, you should be able to use lines of text up to 8000 characters long - j

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Roy Smith
On Friday, December 13, 2013 5:58:49 AM UTC+8, Chris Angelico wrote: > > Now, if you want reliability AND datagrams, it's a lot easier to add > > boundaries to a TCP stream (sentinel or length prefixes) than to add > > reliability to UDP... In article <11cb8cd3-7a12-46b2-abc6-53fbc2a54...@googlegr

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
- Original Message - > Op maandag 16 december 2013 13:05:41 UTC+1 schreef Jean-Michel > Pichavant: > > > Here is the code: > > > #!/usr/bin/env python > > > import telnetlib > > > host = '10.128.59.63' > > > port = 7000 > > > t = Telnet(host, port) > > > t.write('*IDN?\n') > > > print t.r

Re: Downloading multiple files based on info extracted from CSV

2013-12-16 Thread Matt Graves
On Thursday, December 12, 2013 5:20:59 PM UTC-5, Chris Angelico wrote: > import urllib > > import csv > > > > # You actually could get away with not using a with > > # block here, but may as well keep it for best practice > > with open('clients.csv') as f: > > for client in csv.reader(f

Small script to check serial port sucking down system resources.

2013-12-16 Thread sem2jy
i am new to python and programming all together. i wrote a program to watch a serial port and look for a command. then send a tcp packet. all works great but it takes my processor load to about %25. not sure if there is a way to make this more efficient. import serial import socket HOST = '1

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Kevin Walzer
On 12/15/13, 5:06 PM, Chris Angelico wrote: Yeah, but there's a difference between passing your GUI incantations on to a library function (written in C but now just part of a binary library) and feeding them to a completely different language interpreter. When I write something with PyGTK, I can

Re: New to Python, Help to get script working?

2013-12-16 Thread Ned Batchelder
On 12/16/13 3:02 AM, Mark wrote: If i just try to double click the script, i get an index error, i can barely see the window it disappears so fast, but thats what I see. If you're going to participate in this forum, you'll get better help from people if you use the medium well. 1) Sending

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean Dubois
Op maandag 16 december 2013 15:16:17 UTC+1 schreef Jean-Michel Pichavant: > - Original Message - > > Op maandag 16 december 2013 13:05:41 UTC+1 schreef Jean-Michel > > Pichavant: > > > > Here is the code: > > > > #!/usr/bin/env python > > > > import telnetlib > > > > host = '10.128.59.63' >

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Chris Angelico
On Tue, Dec 17, 2013 at 1:55 AM, Kevin Walzer wrote: > Finally, Tcl is itself a fully-featured, general programming language that > is a peer to Python both generationally and in terms of its capabilities; > the main way it lags is in the size of its development community. In other > words, you ar

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Kevin Walzer
On 12/16/13, 10:20 AM, Chris Angelico wrote: Having made a tweak to gitk at one point, I have to say Tcl is definitely inferior to Python. Without starting a flame war, can you elaborate? I'm curious about your perspective. (I studied PSL--Python as a Second Language--so develop in it with a

Re: min max from tuples in list

2013-12-16 Thread rusi
On Sunday, December 15, 2013 9:11:15 AM UTC+5:30, Tim Roberts wrote: > Dennis Lee Bieber wrote: > >>Well "performant" is performant enough for the purposes of communicating > >>on the python list I think :D > > Most probably could figure it out as being stylistically similar to > >conformant =>

Re: min max from tuples in list

2013-12-16 Thread Ned Batchelder
On 12/16/13 10:49 AM, rusi wrote: On Sunday, December 15, 2013 9:11:15 AM UTC+5:30, Tim Roberts wrote: Dennis Lee Bieber wrote: Well "performant" is performant enough for the purposes of communicating on the python list I think :D Most probably could figure it out as being stylisticall

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Chris Angelico
On Tue, Dec 17, 2013 at 2:32 AM, Kevin Walzer wrote: > On 12/16/13, 10:20 AM, Chris Angelico wrote: >> >> Having made a tweak to gitk at one point, I have to say Tcl is >> definitely inferior to Python. > > > Without starting a flame war, can you elaborate? I'm curious about your > perspective. >

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread 88888 Dihedral
On Saturday, December 14, 2013 8:12:16 PM UTC+8, Jai wrote: > GUI:-want to learn GUI programming in python , how should i proceed. > > > > There are lots of book here so I am confuse which book i should refer so > that i don't waste time . please answer Please check JYTHON and those ready-

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
> This is what I got using telnet: > [jean:~] $ telnet 10.128.59.63 7000 > Trying 10.128.59.63... > Connected to 10.128.59.63. > Escape character is '^]'. > *IDN? > KEITHLEY INSTRUMENTS INC.,MODEL 2425,1078209,C32 Oct 4 2010 > 14:20:11/A02 /E/ >

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Grant Edwards
On 2013-12-16, Chris Angelico wrote: > On Tue, Dec 17, 2013 at 2:32 AM, Kevin Walzer wrote: >> On 12/16/13, 10:20 AM, Chris Angelico wrote: >>> >>> Having made a tweak to gitk at one point, I have to say Tcl is >>> definitely inferior to Python. >> >> >> Without starting a flame war, can you elab

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Chris Angelico
On Tue, Dec 17, 2013 at 3:46 AM, Grant Edwards wrote: > * The "everything is a string" view of the world is severly > limiting if you're not just processing strings. I wasn't sure if that was the case, from what I was seeing. Are there any aggregate types at all? ChrisA -- https://mail.py

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Grant Edwards
On 2013-12-16, Chris Angelico wrote: > On Tue, Dec 17, 2013 at 3:46 AM, Grant Edwards > wrote: >> * The "everything is a string" view of the world is severly >> limiting if you're not just processing strings. > > I wasn't sure if that was the case, from what I was seeing. Are there > any a

Concatenate string list to number list to form title - Logic needed.

2013-12-16 Thread Ravi Prabakaran
Hi, I'm completely new to python. I just need simple logic to get output without any loops. I have list of string and list of list of numbers. Each string should be concatenated with every third and fourth values to generate proper titles in list of strings. t = ['Start','End'] a = [[1,2,3,4],

Re: Concatenate string list to number list to form title - Logic needed.

2013-12-16 Thread Chris Angelico
On Tue, Dec 17, 2013 at 4:16 AM, Ravi Prabakaran wrote: > Could anyone please guide me with best solution without loops ? > Why "without loops"? The best solution, in my opinion, is a loop. Is this a specific challenge (homework)? I could make you a list comprehension, but that's really just anot

Determining whether a glyph is available in Tkinter

2013-12-16 Thread wmcbrine
I have a Tkinter app that can optionally label some buttons with certain Unicode glyphs that aren't always available (depending on the OS, etc.). When they aren't available, Tkinter renders them as "\u". What I'd like to do is check whether the glyphs are available, and fall back to my own a

Re: Concatenate string list to number list to form title - Logic needed.

2013-12-16 Thread Mark Lawrence
On 16/12/2013 17:16, Ravi Prabakaran wrote: Hi, I'm completely new to python. I just need simple logic to get output without any loops. I have list of string and list of list of numbers. Each string should be concatenated with every third and fourth values to generate proper titles in list of s

Re: Concatenate string list to number list to form title - Logic needed.

2013-12-16 Thread Chris Angelico
On Tue, Dec 17, 2013 at 4:41 AM, Ravi Prabakaran wrote: >> Hi Chris, > > Thanks for reply. If you have any good idea with loop, please post. But > i'm looking same without loop because python has slicing,concatenating and > other straight forward feature. I guess it can be done without loop. M

Re: Concatenate string list to number list to form title - Logic needed.

2013-12-16 Thread Chris Angelico
On Tue, Dec 17, 2013 at 4:51 AM, Chris Angelico wrote: > t = ['Start','End'] > a = [[1,2,3,4], > [5,6,7,8]] > result = [] > for cur in a: > result.append("%s - %d"%(t[0],cur[2])) > result.append("%s - %d"%(t[1],cur[3])) Whoops, I misread the desired output, I thought you wanted a f

Re: Concatenate string list to number list to form title - Logic needed.

2013-12-16 Thread Jussi Piitulainen
Ravi Prabakaran writes: > I'm completely new to python. I just need simple logic to get output > without any loops. > I have list of string and list of list of numbers. > Each string should be concatenated with every third and fourth > values to generate proper titles in list of strings. > > t =

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean Dubois
Op maandag 16 december 2013 17:44:31 UTC+1 schreef Jean-Michel Pichavant: > > This is what I got using telnet: > > [jean:~] $ telnet 10.128.59.63 7000 > > Trying 10.128.59.63... > > Connected to 10.128.59.63. > > Escape character is '^]'. > > *IDN? > > KEITHLEY INSTRUMENTS INC.,MODEL 2425,1078209,C

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Chris Angelico
On Tue, Dec 17, 2013 at 5:26 AM, Jean Dubois wrote: >> Try something simple first: >> import telnetlib >> host = '10.128.59.63' >> port = 7000 >> t = Telnet(host, port) >> def flush() >> t.read_very_eager() >> def sendCmd(cmd) >> t.write('%s\n' % cmd) >> return flush() >> flush() >> print se

Re: Concatenate string list to number list to form title - Logic needed.

2013-12-16 Thread Peter Otten
Jussi Piitulainen wrote: > Ravi Prabakaran writes: > >> I'm completely new to python. I just need simple logic to get output >> without any loops. >> I have list of string and list of list of numbers. >> Each string should be concatenated with every third and fourth >> values to generate proper t

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Dave Angel
On Mon, 16 Dec 2013 10:26:14 -0800 (PST), Jean Dubois wrote: File "./test.py", line 7 def flush() ^ SyntaxError: invalid syntax A definition line needs to end with a colon (fix the other as well) -- DaveA -- https://mail.python.org/mailman/listinfo/python-list

Re: Concatenate string list to number list to form title - Logic needed.

2013-12-16 Thread John Gordon
In <2333bfb4-cd72-4ed0-9b28-d8dbe26b5...@googlegroups.com> Ravi Prabakaran writes: > Hi, > I'm completely new to python. I just need simple logic to get output without > any loops. > I have list of string and list of list of numbers. > Each string should be concatenated with every third and fou

Re: Small script to check serial port sucking down system resources.

2013-12-16 Thread MRAB
On 16/12/2013 14:31, sem...@gmail.com wrote: i am new to python and programming all together. i wrote a program to watch a serial port and look for a command. then send a tcp packet. all works great but it takes my processor load to about %25. not sure if there is a way to make this more efficie

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
- Original Message - > On Tue, Dec 17, 2013 at 5:26 AM, Jean Dubois > wrote: > >> Try something simple first: > >> import telnetlib > >> host = '10.128.59.63' > >> port = 7000 > >> t = Telnet(host, port) > >> def flush() > >> t.read_very_eager() > >> def sendCmd(cmd) > >> t.write('%s

Re: Determining whether a glyph is available in Tkinter

2013-12-16 Thread Terry Reedy
On 12/16/2013 12:32 PM, wmcbr...@gmail.com wrote: I have a Tkinter app that can optionally label some buttons with certain Unicode glyphs that aren't always available (depending on the OS, etc.). It depends on the font in use. The best scenario would be to always use the same unicode font. Idl

RE: Question RE urllib

2013-12-16 Thread Jeff James
Sorry to be a pain here, guys, as I'm also a newbie at this as well. Where, exactly in the script would I place the " print str(e) " ? Thanks Original message : I'm not really receiving an "exception" other than those three sites, out > of the 30 or so I have listed, are the only sites which s

Re: Question RE urllib

2013-12-16 Thread Larry Martell
On Mon, Dec 16, 2013 at 2:55 PM, Jeff James wrote: > Sorry to be a pain here, guys, as I'm also a newbie at this as well. > > Where, exactly in the script would I place the " print str(e) " ? The line after the print site + " is down" line. > > Thanks > > Original message : > >> I'm not really

Re: Small script to check serial port sucking down system resources.

2013-12-16 Thread Grant Edwards
On 2013-12-16, MRAB wrote: > On 16/12/2013 14:31, sem...@gmail.com wrote: > >> i wrote a program to watch a serial port and look for a command. then >> send a tcp packet. all works great but it takes my processor load to >> about %25. not sure if there is a way to make this more efficient. >> >> i

Re: Concatenate string list to number list to form title - Logic needed.

2013-12-16 Thread Terry Reedy
On 12/16/2013 12:43 PM, Mark Lawrence wrote: On 16/12/2013 17:16, Ravi Prabakaran wrote: Hi, I'm completely new to python. I just need simple logic to get output without any loops. I have list of string The remainder of your description and example imply that this must be a sequence of exactl

Re: Question Re urllib (Resolved)

2013-12-16 Thread Jeff James
This worked perfectly. Thank You Where, exactly in the script would I place the " print str(e) " ? The line after the print site + " is down" line. Original Post : I'm not really receiving an "exception" other than those three sites, out of the 30 or so I have listed, are the only sites

Re: New to Python, Help to get script working?

2013-12-16 Thread Mark
I am sorry if the way I posted messages was incorrect. Like I said, I am new to google groups and python quite a bit but i am trying to do things correctly by you guys. The errors that I am getting were not necessarily posting traceback messages. In those messages I posted my last bit of confus

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

2013-12-16 Thread Wolfgang Keller
> > And ever after that experience, I avoided all languages that were > > even remotely similar to C, such as C++, Java, C#, Javascript, PHP > > etc. > > I think that's disappointing, for two reasons. Firstly, C syntax isn't > that terrible. It's not just the abysmally appalling, hideously horrif

Re: Question RE urllib

2013-12-16 Thread John Gordon
In Jeff James writes: > --f46d04479f936227ee04edac31bd > Content-Type: text/plain; charset=ISO-8859-1 > Sorry to be a pain here, guys, as I'm also a newbie at this as well. > Where, exactly in the script would I place the " print str(e) " ? except Exception, e: print site + " is

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean Dubois
Op maandag 16 december 2013 20:21:15 UTC+1 schreef Jean-Michel Pichavant: > - Original Message - > > On Tue, Dec 17, 2013 at 5:26 AM, Jean Dubois > > wrote: > > >> Try something simple first: > > >> import telnetlib > > >> host = '10.128.59.63' > > >> port = 7000 > > >> t = Telnet(host, po

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Christian Gollwitzer
Let the flame war begin! Am 16.12.13 17:10, schrieb Chris Angelico: Here's the Tcl procedure that I tweaked. This is from gitk; I find the word diff not all that useful, but a character diff at times is very useful. I haven't found a way to configure the word diff regex through gitk's options, so

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Christian Gollwitzer
Am 16.12.13 18:04, schrieb Grant Edwards: On 2013-12-16, Chris Angelico wrote: On Tue, Dec 17, 2013 at 3:46 AM, Grant Edwards wrote: * The "everything is a string" view of the world is severly limiting if you're not just processing strings. I wasn't sure if that was the case, from w

Re: Type of an object: ‘obj.__class__’ versus ‘type(obj)’

2013-12-16 Thread Steven D'Aprano
On Mon, 16 Dec 2013 12:51:21 +1100, Ben Finney wrote: > Howdy all, > > What is the Pythonic way to determine the type of an object? Are there > multiple valid ways, and when should each be used? That is an excellent question, I only wish I had an excellent answer to give you. Obviously great mi

[newbie] Saving binaries in a specific way

2013-12-16 Thread Djoser
Hi all, I am new to this forum and also to Python, but I'm trying hard to understand it better. I need to create a binary file, but the first 4 lines must be in signed-Integer16 and all the others in signed-Integer32. I have a program that does that with Matlab and other with Mathematica, but

Re: [newbie] Saving binaries in a specific way

2013-12-16 Thread Chris Kaynor
On Mon, Dec 16, 2013 at 2:19 PM, Djoser wrote: > Hi all, > > I am new to this forum and also to Python, but I'm trying hard to > understand it better. > I need to create a binary file, but the first 4 lines must be in > signed-Integer16 and all the others in signed-Integer32. I have a program >

Re: Packaging a private project

2013-12-16 Thread Oscar Benjamin
On Dec 16, 2013 11:20 AM, "Nicholas Cole" wrote: > > Dear List, > > What is the best way to distribute a private, pure python, Python 3 > project that needs several modules (some available on pypi but some > private and used by several separate projects) in order to run? > > I'd like to include ev

Re: [newbie] Saving binaries in a specific way

2013-12-16 Thread Djoser
I'm using python 2.7. If I understood correctly, using bytearray I will lost the information about the signed 16, 32, since it makes automatically the conversion. Do you think that I can make the conversion as I proposed before or using struct and save with open()? -- https://mail.python.org/m

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Chris Angelico
On Tue, Dec 17, 2013 at 9:06 AM, Christian Gollwitzer wrote: > Let the flame war begin! I'll try to avoid flamage :) > First off, gitk is a huge unstructured mess. You are not obliged to write > programs like this in Tcl, at least not today. All these global statements > give already a hint, tha

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Gregory Ewing
Grant Edwards wrote: On 2013-12-16, Chris Angelico wrote: Are there any aggregate types at all? There are arrays with string keys (similar to Python dictionaries). Well... sort of. They can only hold strings, not other arrays. They're not first-class entities: you can't pass them around or

Re: [newbie] Saving binaries in a specific way

2013-12-16 Thread Tim Chase
On 2013-12-16 14:19, Djoser wrote: > I am new to this forum and also to Python, but I'm trying hard to > understand it better. Welcome aboard! > I need to create a binary file, but the first 4 lines must be in > signed-Integer16 and all the others in signed-Integer32. I have a > program that doe

Re: min max from tuples in list

2013-12-16 Thread Gregory Ewing
Ned Batchelder wrote: On 12/16/13 10:49 AM, rusi wrote: And things that have consistency are of course... consistant (not consistent) In English, it's spelled consistent: http://en.wiktionary.org/wiki/consistant So to be consistent we should spell it performent? :-) -- Greg -- https://m

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

2013-12-16 Thread Rhodri James
On Mon, 16 Dec 2013 20:32:25 -, Wolfgang Keller wrote: > And ever after that experience, I avoided all languages that were > even remotely similar to C, such as C++, Java, C#, Javascript, PHP > etc. I think that's disappointing, for two reasons. Firstly, C syntax isn't that terrible. I

Re: [newbie] Saving binaries in a specific way

2013-12-16 Thread Djoser
Basically I have a .dat file, so I get some numbers and make a different conversion. I'll try this struct script. I'm not used to it, but it seems to do what I want. -- https://mail.python.org/mailman/listinfo/python-list

Re: Determining whether a glyph is available in Tkinter

2013-12-16 Thread wmcbrine
I'm not going to control the font. This is for a program that's distributed to the general public, for use on a wide variety of systems. But what I do in the current version is to use the ASCII label strings by default, and have a command-line option to select the "graphical" (non-ASCII Unicode)

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Terry Reedy
On 12/16/2013 5:40 PM, Chris Angelico wrote: Nice, though Python's threading and/or multiprocessing can do 90% of what people want. Side point: What about Tk? Can you (a) run separate GUI threads for separate windows? (b) manipulate widgets created by another thread? When running tk via tkinte

  1   2   >