Re: How to set my gui?

2013-04-19 Thread Tracubik
On 19/04/2013 10:42, Alister wrote: On Thu, 18 Apr 2013 23:24:29 +0200, Tracubik wrote: Hi all! I'm trying to make a simple program that essentially do this: 1) open a html file (extracted epub file) 2) search for occurrences like "ita-ly" 3) put them on a simple GUI: 1 tex

Re: How to set my gui?

2013-04-18 Thread Tracubik
On 18/04/2013 23:27, John Gordon wrote: In <5170648d$0$1368$4fafb...@reader2.news.tin.it> Tracubik writes: i suppose i've to first generate the window and than populate it, but where i've to put the "search for occurences" code? I don't think init() is the r

How to set my gui?

2013-04-18 Thread Tracubik
Hi all! I'm trying to make a simple program that essentially do this: 1) open a html file (extracted epub file) 2) search for occurrences like "ita-ly" 3) put them on a simple GUI: 1 text field and two buttons: keepy it and correct it (i.e. it will become italy) now this is quite simple but ho

editing a HTML file

2013-03-14 Thread Tracubik
Hi all, I'would like to make a script that automatically change some text in a html file. I need to make some changes in the text of tags My question is: there is a way to just "update/substitute" the text in the html tags or do i have to make a new modified copy of the html file? To be

Image.paste with images with different palettes...

2012-10-19 Thread Tracubik
Hi all! I'm trying to create a map generator for c64's games it's a simple script and it work properly, but i've problem if i try to modify images before creating the map. what i do is: - take a 8 bit screenshoot with VICE emulator in gif or bmp format - open shutter (screenshoot edit tool und

Re: search google with python

2012-01-25 Thread Tracubik
Il Wed, 25 Jan 2012 02:27:18 -0800, Chris Rebert ha scritto: > On Wed, Jan 25, 2012 at 1:55 AM, Tracubik wrote: >> Hi all, >> i'ld like to make a simple program for searching images from python. >> All it have to do is make a search in google images and return the

search google with python

2012-01-25 Thread Tracubik
Hi all, i'ld like to make a simple program for searching images from python. All it have to do is make a search in google images and return the link of the images (20 images is enough i think) Is there any API or modules i can use? Thanks a lot Nico -- http://mail.python.org/mailman/listinfo/py

understanding a program project

2012-01-13 Thread Tracubik
Hi all, i hope not to be too much OT with this request. I'ld like to modify/contribute some open source in python, but first i've to read and understand the code. So, is there some guide lines / procedure to follow to help me in this process. I remember at school time there was some schema or som

pls explain this flags use

2011-12-28 Thread Tracubik
Hi all, i've found here (http://python-gtk-3-tutorial.readthedocs.org/en/latest/ layout.html#table) this code: [quote] If omitted, xoptions and yoptions defaults to Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL. [end quote] xoptions have 3 flags: EXPAND, FILL, SHRINK so, how it is supposed

my new project, is this the right way?

2011-11-14 Thread Tracubik
Hi all, i'm developing a new program. Mission: learn a bit of database management Idea: create a simple, 1 window program that show me a db of movies i've seen with few (<10) fields (actors, name, year etc) technologies i'll use: python + gtk db: that's the question since i'm mostly a new-bye fo

Re: bash command, get stdErr

2011-08-26 Thread Tracubik
Il Fri, 26 Aug 2011 01:20:02 -0700, Chris Rebert ha scritto: > On Fri, Aug 26, 2011 at 12:56 AM, Tracubik wrote: >> Il Thu, 25 Aug 2011 01:52:25 -0700, Chris Rebert ha scritto: >>> On Thu, Aug 25, 2011 at 1:25 AM, Tracubik wrote: >>>> Hi all! >> >> cu

Re: bash command, get stdErr

2011-08-26 Thread Tracubik
Il Thu, 25 Aug 2011 08:25:59 +, Tracubik ha scritto: > Hi all! > i'ld like to execute via Python this simple bash command: > > sudo las > > las is intended to be a typo for "ls" > > the point is that i want to see in the terminal the stderr message (t

Re: bash command, get stdErr

2011-08-26 Thread Tracubik
Il Thu, 25 Aug 2011 01:52:25 -0700, Chris Rebert ha scritto: > On Thu, Aug 25, 2011 at 1:25 AM, Tracubik wrote: >> Hi all! cut > Untested: > > from subprocess import Popen, PIPE sudo = Popen("sudo las", shell=True, > stderr=PIPE) > tee = Popen(["tee"

bash command, get stdErr

2011-08-25 Thread Tracubik
Hi all! i'ld like to execute via Python this simple bash command: sudo las las is intended to be a typo for "ls" the point is that i want to see in the terminal the stderr message (that is "sorry, try again" if i insert the wrong password or "sudo: las: command not found" otherwise) i can sim

split long string in two code lines

2011-06-13 Thread Tracubik
Hi all, newbie question here how can i write code like this: 1 def foo(): 2for index in ... 3for plsdoit in ... 4print "this is a very long string that i'm going to write 5 here, it'll be for sure longer than 80 columns" the only way i've found is to use the "/", but

help me reviewing and organizing my code =)

2011-06-02 Thread Tracubik
if you like, off course :) I'm making a port in python of a program made of bash commands + zenity for the GUI. so, i've to re-create a GUI in pyGTK and associate the right bash commands to the buttons. Instead of executing the bash script i simply print they in the console. so, here's my code

Re: pyGTK identify a button

2011-05-25 Thread Tracubik
On 25/05/2011 10:44, Claudiu Nicolaie CISMARU wrote: the two button are connected (when clicked) to infoButton(self, widget, data=None) From documentation: handler_id = object.connect(name, func, func_data) So: button1.connect(when is pressed, your_function, 1) button2.connect(when is presse

pyGTK identify a button

2011-05-25 Thread Tracubik
Hi all, i'm trying to write a simple windows with two button in GTK, i need a way to identify wich button is pressed. Consider that: the two button are connected (when clicked) to infoButton(self, widget, data=None) infoButton() is something like this infoButton(self, widget, data=None):

regular expression i'm going crazy

2011-05-16 Thread Tracubik
pls help me fixing this: import re s = "linka la baba" re_s = re.compile(r'(link|l)a' , re.IGNORECASE) print re_s.findall(s) output: ['link', 'l'] why? i want my re_s to find linka and la, he just find link and l and forget about the ending a. can anyone help me? trying the regular expressio

PyGTK notebook: get current page

2011-05-07 Thread Tracubik
Hi all! I've made a simple PyGTK program. It's a window with a notebook, the notebook have 2 pages When changing page, i'ld like to get the id of current page. I've coded it, but i can get only the previously open page, not the current one. This is not a big deal if i have only 2 pages, but it co

strange use of %s

2011-04-18 Thread Tracubik
Hi all, i'm reading a python tutorial in Ubuntu's Full Circle Magazine and i've found this strange use of %s: sql = "SELECT pkid,name,source,servings FROM Recipes WHERE name like '%%%s% %'" %response response is a string. I've newbie in sql. why do the coder use %%%s%% instead of a simple %s? w

how to get and search a html file from a website

2011-02-01 Thread Tracubik
Hi all! i'm writing a notification program and i'm quite new to python. The program have to check every 5 minutes a particular website and alert me when a particular sentence ("user online") is in the html. i've thinked to use a text browser (lynx) to retrieve the html and parse the output in pyt

email discovering code

2010-12-08 Thread Tracubik
Hi all, i remember i've found somewhere (i think here but i'm not sure) a signature of a user with a strange python code that, if runned on terminal, reveal the email of the contact Can anyone help me finding it? thanks Nico -- http://mail.python.org/mailman/listinfo/python-list

strange behavor....

2010-11-13 Thread Tracubik
hi all, i've this on python 2.6.6: >>> def change_integer(int_value): ... int_value = 10 ... ... def change_list(list): ... list[0] = 10 ... ... a = 1 ... l = [1,1,1] ... ... change_integer(a) ... change_list(l) ... ... print a ... print l 1 [10, 1, 1] why the integer value do

Re: str(int_var) formatted

2010-10-30 Thread Tracubik
Il Fri, 29 Oct 2010 19:18:41 -0700, John Yeung ha scritto: > On Oct 29, 11:59 am, Tracubik wrote: >> i've to convert integer x to string, but if x < 10, the string have to >> be '0x' instead of simple 'x' >> >> for example: >> >&

str(int_var) formatted

2010-10-29 Thread Tracubik
Hi all, i've to convert integer x to string, but if x < 10, the string have to be '0x' instead of simple 'x' for example: x = 9 str(x) --> '09' x = 32 str(x) --> '32' x represent hour/minute/second. I can easily add '0' with a if then block, but is there a built-in way to add the '0' automat

will Gnome 3.0 kill pygtk?

2010-09-30 Thread Tracubik
Hi! It seem that the new version of gnome 3.0 will dismiss pygtk support. link: [1] http://live.gnome.org/TwoPointNinetyone/ (search killing pygtk) [2] http://live.gnome.org/GnomeGoals/PythonIntrospectionPorting i'm studying pygtk right now, am i wasting my time considering that my preferr

if the else short form

2010-09-29 Thread Tracubik
Hi all, I'm studying PyGTK tutorial and i've found this strange form: button = gtk.Button(("False,", "True,")[fill==True]) the label of button is True if fill==True, is False otherwise. i have googled for this form but i haven't found nothing, so can any of you pass me any reference/link to thi

catch clipboard status in gnome

2010-04-08 Thread Tracubik
Hi all, i'ld like to create an gnome applet in python that, if left-clicked, perform a particular operation using the text of the clipboard. i've found this example: import pygtk pygtk.require('2.0') import gtk # get the clipboard clipboard = gtk.clipboard_get() # read the clipboard text data.

Python + OpenOffice Calc

2010-03-31 Thread Tracubik
Hi all! i'm giving away to a friend of mine that have a garage (he repair car) my old computer. He will use it essentialy to create estimates of the work via an ods file (i've made a simple ods file to be filled with the cost of materials and a description of the work). He's totally new with com

Re: case do problem

2010-03-03 Thread Tracubik
Il Wed, 03 Mar 2010 09:39:54 +0100, Peter Otten ha scritto: > Tracubik wrote: > >> hi, i've to convert from Pascal this code: > > program loop; > > function generic_condition: boolean; > begin >generic_condition := random > 0.7 > end; > >

Re: case do problem

2010-03-02 Thread Tracubik
additional information: when count=4 i haven't to change the m value, so i have to do nothing or something like m = m Nico -- http://mail.python.org/mailman/listinfo/python-list

case do problem

2010-03-02 Thread Tracubik
hi, i've to convert from Pascal this code: iterations=0; count=0; REPEAT; iterations = iterations+1; ... IF (genericCondition) THEN count=count+1; ... CASE count OF: 1: m = 1 2: m = 10 3: m = 100 UNTIL count = 4 OR iterations = 20 i do something like this: itera

round() function

2010-02-25 Thread Tracubik
hi all, i've this sample code: >>> n = 4.499 >>> str(round(n,2)) '4.5' that's right, but what i want is '4.50' to be displayed instead of '4.5'. Off course i know that 4.5 = 4.50, still i'ld like to have 4.50. How can I solve this? Thanks in advance Nico -- http://mail.python.org/mailman/listi

Re: create a string of variable lenght

2010-02-01 Thread Tracubik
Il Sun, 31 Jan 2010 19:54:17 -0500, Benjamin Kaplan ha scritto: > First of all, if you haven't read this before, please do. It will make > this much clearer. > http://www.joelonsoftware.com/articles/Unicode.html i'm reading it right now, thanks :-) [cut] > Solution to your problem: in addition

Re: create a string of variable lenght

2010-01-31 Thread Tracubik
Il Sun, 31 Jan 2010 13:46:16 +0100, Günther Dietrich ha scritto: > Maybe you might solve this if you decode your string to unicode. > Example: > > |>>> euro = "€" > |>>> len(euro) > |3 > |>>> u_euro = euro.decode('utf_8') > |>>> len(u_euro) > |1 > > Adapt the encoding ('utf_8' in my example) to

create a string of variable lenght

2010-01-31 Thread Tracubik
Hi all, i want to print on linux console (terminal) a message like this one: error message of variable lenght to print the asterisks line i do this: def StringOfAsterisks(myString): asterisksString = "*" for i in range(1,