[Tutor] pyqt4 set horizontal header item

2013-03-31 Thread Phil

Thank you for reading this.

I want to set a table widget header based on its cell contents.

The following sets all of the headers;

self.tableWidget.setHorizontalHeaderLabels(["One", "Two", "Etc"])

However, self.setHorizontalHeaderItem ( 1, ["test"]) and 
self.setHorizontalHeaderItem ( 1, "test") fail with the following error;


"'MainWindow' object has no attribute 'setHorizontalHeaderItem'"

setHorizontalHeaderItem() exists in the documentation so I must be using 
it incorrectly. I've played with this for quite some time and searched 
the Internet for an answer. Can anyone offer a suggestion?


--
Regards,
Phil
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] pyqt4 set horizontal header item - extra info

2013-03-31 Thread Phil

On 31/03/13 14:29, Phil wrote:

Thank you for reading this.

I want to set a table widget header based on its cell contents.

The following sets all of the headers;

self.tableWidget.setHorizontalHeaderLabels(["One", "Two", "Etc"])

However, self.setHorizontalHeaderItem ( 1, ["test"]) and
self.setHorizontalHeaderItem ( 1, "test") fail with the following error;

"'MainWindow' object has no attribute 'setHorizontalHeaderItem'"

setHorizontalHeaderItem() exists in the documentation so I must be using
it incorrectly. I've played with this for quite some time and searched
the Internet for an answer. Can anyone offer a suggestion?



I now realise the correct syntax is;

self.tableWidget.setHorizontalHeaderItem (1, QTableWidgetItem *item)

I have done this many years ago in C++ but I don't quite see how to get 
a QTableWidgetItem in Python.


--
Regards,
Phil
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] pyqt4 set horizontal header item - extra info

2013-03-31 Thread Alan Gauld

On 31/03/13 08:30, Phil wrote:


self.tableWidget.setHorizontalHeaderItem (1, QTableWidgetItem *item)

I have done this many years ago in C++ but I don't quite see how to get
a QTableWidgetItem in Python.



Presumably by instantiating a TableWidgetItem class?
But you will likely get better help on Qt topics by asking on a Qt 
specific forum rather than a Python beginners list like this.

There are a few Qt users here but most are not.


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] pyqt4 set horizontal header item - extra info

2013-03-31 Thread eryksun
On Sun, Mar 31, 2013 at 4:23 AM, Alan Gauld  wrote:
> On 31/03/13 08:30, Phil wrote:
>
>> self.tableWidget.setHorizontalHeaderItem (1, QTableWidgetItem *item)
>>
>> I have done this many years ago in C++ but I don't quite see how to get
>> a QTableWidgetItem in Python.
>
> Presumably by instantiating a TableWidgetItem class?
> But you will likely get better help on Qt topics by asking on a Qt specific
> forum rather than a Python beginners list like this.
> There are a few Qt users here but most are not.

You can use setHorizontalHeaderItem(0, QTableWidgetItem('col 0'), and
so on. It may be simpler to use setHorizontalHeaderLabels(['col 0',
'col 1', 'etc']).
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Want to create a facebook Application for linux desktop

2013-03-31 Thread chandan kumar
Hello,
I want to create a facebook application for Linux desktop.
This application will download all the news feeds of all my friends to whom
i am subscribed.
It also helps to update status and upload photos.
I donot know how to get started.
I have searched google, but not found any relevant information for this.
Please tell me to how to get started to execute this using python.

Thanks,
With Best Wishes,
Chandan Kumar
Final Year, Computer Science and Engineering
Dr.B.C.Roy Engineering College, Durgapur
https://ciypro.wordpress.com
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Traceback problem

2013-03-31 Thread Murali Mannava
Hi,
I am trying to execute a program and it's giving the following problem and
preventing me to go further. Can you please tell me what the problem is?
Thank you,
Murali.

Traceback (most recent call last):

  File "pwp_client.py", line 58, in 

RESULTS = client.run_project(models[action] , areq )

  File "C:\Users\mmannava\downloads\\network\clents\socket_tcp.py", line
127, in run_project

return  ast.literal_eval(res)

  File "C:\Python27\lib\ast.py", line 49, in literal_eval

node_or_string = parse(node_or_string, mode='eval')

  File "C:\Python27\lib\ast.py", line 37, in parse

return compile(source, filename, mode, PyCF_ONLY_AST)

  File "", line 0



^

SyntaxError: unexpected EOF while parsing
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Traceback problem

2013-03-31 Thread Mark Lawrence

On 31/03/2013 17:30, Murali Mannava wrote:

Hi,
I am trying to execute a program and it's giving the following problem
and preventing me to go further. Can you please tell me what the problem is?
Thank you,
Murali.

Traceback (most recent call last):

   File "pwp_client.py", line 58, in 

 RESULTS = client.run_project(models[action] , areq )

   File "C:\Users\mmannava\downloads\\network\clents\socket_tcp.py",
line 127, in run_project

 return ast.literal_eval(res)

   File "C:\Python27\lib\ast.py", line 49, in literal_eval

 node_or_string = parse(node_or_string, mode='eval')

   File "C:\Python27\lib\ast.py", line 37, in parse

 return compile(source, filename, mode, PyCF_ONLY_AST)

   File "", line 0

 ^

SyntaxError: unexpected EOF while parsing



Can't be definitive without seeing your source but this error often 
occurs when you've missed a closing bracket of some kind.  A combination 
of any semi-decent editor that's got syntax highlighting and the MKI 
eyeball can often fix this :)


--
If you're using GoogleCrap™ please read this 
http://wiki.python.org/moin/GoogleGroupsPython.


Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Want to create a facebook Application for linux desktop

2013-03-31 Thread Alan Gauld

On 31/03/13 16:09, chandan kumar wrote:


I have searched google, but not found any relevant information for this.
Please tell me to how to get started to execute this using python.


What is your background? Can you already program in Python?
Can you program in other languages?
Given your .sig I assume the answer is yes to both?

What did you Google? I don't know if Facebook has a
published API? If not you will have to web scrape it
in which case you need libraries like Beautiful Soup,
or maybe etree.

You'll also need to read up on the urllib and HTML family.

Have you any idea how to structure the program? Have you got an overall 
architecture in mind? Will it be a daemon? A web server?  A traditional 
client/server? Or will it be a homogenous desktop app?


What about data stores? Will you cache data locally or assume
permanent 'cloud' access? Do you have a data or object model
in mind? Are you using OOP or procedural style?

Hopefully those questions will help you formulate your ideas if
you have not already done so.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Traceback problem

2013-03-31 Thread Alan Gauld

On 31/03/13 17:30, Murali Mannava wrote:


and preventing me to go further. Can you please tell me what the problem is?



   File "C:\Python27\lib\ast.py", line 37, in parse
 return compile(source, filename, mode, PyCF_ONLY_AST)
   File "", line 0
 ^
SyntaxError: unexpected EOF while parsing


You apparently have a syntax error in the file that it is
trying to parse. As a result the parser unexpectedly
reached the end of the file.

Does that help?

If not, we will need a bit more information.
Like what are you trying to do? And with what data?

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] create a facebook Application for linux desktop

2013-03-31 Thread chandan kumar
Hello,
I want to create a facebook application for Linux desktop.
This application will download all the news feeds of all my friends to whom
i am subscribed.
It also helps to update status and upload photos.
I donot know how to get started.
I have searched google, but not found any relevant information for this.
Please tell me to how to get started to execute this using python.

Thanks,

With Best Wishes,

Chandan Kumar
Final Year, Computer Science and Engineering
Dr.B.C.Roy Engineering College, Durgapur
https://ciypro.wordpress.com
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] change of email

2013-03-31 Thread Dipo Elegbede
Hi,

I would like to have my email changed from delegb...@dudupay.com to
dipo.elegb...@dipoelegbede.com

I have not in a long time used this email and as such would like all
correspondences sent to the new email so that I can resume my participation
in the group.

I sincerely hope this would be given a top priority while I'm quite aware
of your very busy schedule.

I appreciate your efforts and look forward to resuming participation as
soon as my email address is changed.

Thank you.

-- 
Elegbede Muhammed Oladipupo
OCA
+2348077682428
+2347042171716
www.dudupay.com
Mobile Banking Solutions | Transaction Processing | Enterprise Application
Development
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] change of email

2013-03-31 Thread Chris “Kwpolska” Warrick
On Sun, Mar 31, 2013 at 5:31 PM, Dipo Elegbede  wrote:
>
> Hi,
>
> I would like to have my email changed from delegb...@dudupay.com to 
> dipo.elegb...@dipoelegbede.com
> [snip bullshit]
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>

Unsubscribe and resubscribe at
http://mail.python.org/mailman/listinfo/tutor — just as the signature
below your mail claims!  BTW, did you perchance produce your mail
address through having a cat sit on your keyboard?

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] create a facebook Application for linux desktop

2013-03-31 Thread Joel Goldstick
On Sun, Mar 31, 2013 at 12:37 PM, chandan kumar <
chandankumar.093...@gmail.com> wrote:

> Hello,
> I want to create a facebook application for Linux desktop.
> This application will download all the news feeds of all my friends to
> whom i am subscribed.
> It also helps to update status and upload photos.
> I donot know how to get started.
> I have searched google, but not found any relevant information for this.
> Please tell me to how to get started to execute this using python.
>
>
Maybe start here: http://developers.facebook.com/

> Thanks,
>
> With Best Wishes,
>
> Chandan Kumar
> Final Year, Computer Science and Engineering
> Dr.B.C.Roy Engineering College, Durgapur
> https://ciypro.wordpress.com
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>


-- 
Joel Goldstick
http://joelgoldstick.com
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] create a facebook Application for linux desktop

2013-03-31 Thread Mark Lawrence

On 31/03/2013 17:37, chandan kumar wrote:

Hello,
I want to create a facebook application for Linux desktop.
This application will download all the news feeds of all my friends to
whom i am subscribed.
It also helps to update status and upload photos.
I donot know how to get started.
I have searched google, but not found any relevant information for this.
Please tell me to how to get started to execute this using python.

Thanks,

With Best Wishes,

Chandan Kumar
Final Year, Computer Science and Engineering
Dr.B.C.Roy Engineering College, Durgapur
https://ciypro.wordpress.com



Did you really have to post this one hour and 28 minutes after your 
first post with a slightly different title?


--
If you're using GoogleCrap™ please read this 
http://wiki.python.org/moin/GoogleGroupsPython.


Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] change of email

2013-03-31 Thread Joel Goldstick
On Sun, Mar 31, 2013 at 11:31 AM, Dipo Elegbede wrote:

> Hi,
>
> I would like to have my email changed from delegb...@dudupay.com to
> dipo.elegb...@dipoelegbede.com
>
> I have not in a long time used this email and as such would like all
> correspondences sent to the new email so that I can resume my participation
> in the group.
>
> I sincerely hope this would be given a top priority while I'm quite aware
> of your very busy schedule.
>
> I appreciate your efforts and look forward to resuming participation as
> soon as my email address is changed.
>
> Thank you.
>
>
You need to do this yourself.  See the address below to subscribe and
unsubscribe

> --
> Elegbede Muhammed Oladipupo
> OCA
> +2348077682428
> +2347042171716
> www.dudupay.com
> Mobile Banking Solutions | Transaction Processing | Enterprise Application
> Development
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>


-- 
Joel Goldstick
http://joelgoldstick.com
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] pyqt4 set horizontal header item - extra info

2013-03-31 Thread Phil

On 31/03/13 21:43, eryksun wrote:




You can use setHorizontalHeaderItem(0, QTableWidgetItem('col 0'), and
so on. It may be simpler to use setHorizontalHeaderLabels(['col 0',
'col 1', 'etc']).



Thanks Eryksun,

I had already tried your suggestion last night and this is the result;

"global name 'QTableWidgetItem' is not defined"

You are correct, I can easily set all of the labels at once but only one 
label needs to be modified according to it's cell contents. I'm sure I'm 
missing something very basic.


--
Regards,
Phil
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] is there a simple stand alone python app I can use on my Kindle fire?

2013-03-31 Thread ah
Hello,


I'm enjoying learning python, and would like to be able to study and practice 
on the go, using my kindle fire reader. (wifi enabled).


Amazon does have an app, Qpython lite, but requires a  live wifi connection to 
the internet to run. I'm looking for a simple python app, stand alone that i 
can run on my kindle, without an internet connection,  just to practice while i 
learn. (Just a simple terminal, and text editor, and python? like ubuntu 
offers.)


I've tried downloading portable python, and couldnt' get it to run ('can't run 
in DOS mode?'), I've tried downloading ubuntu to my kindle and couldn't, and 
tried downloading the whole 2.7 python app, but couldn't get it to run.

I tried to root my kindle, but as I'm inexperienced in things tech, i'm not 
sure if I was successful, and not sure how this helps (if I was successful.)


I have both windows 7 and ubuntu (dual boot) on my laptop, and can connect my 
kindle to the laptop via usb cable. I have "accept downloads from other 
applications" enabled on my kindle. On my kindle I have 'better terminal 
emulator pro' , ES file explorer, and droidedit.


Any help is appreciated, I'm willing to follow step by step instructions to get 
python running on my kindle. I will supply any other details required.


My kindle fire specs are : Model D01400



The Kindle Fire features a 7” display module from LG Display. The 
display is dual-sourced between LG Display and E Ink Holdings. The 
display touchscreen appears to be conventional capacitive glass on glass and 
the control IC on the touchscreen is from a previously unseen 
source. Meanwhile, the OMAP4430 applications processor from Texas 
Instruments is a dual-core RM Cortex-A9, 1GHz processor with IVA 3 
Hardware Accelerator, SGX540 3D Graphic Core, 1080P 2D, 720P 3D and is 
produced in 45nm process geometry. 

Other key features include a
 8GB eMMC NAND Flash Memory, 4Gbits of low power DDR2, a 3.7V battery 
with 4400mAh capacity (or about 16 Wh), and a module from Jorjin, which 
is based on Texas Instruments’ WL1270. ___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] pyqt4 set horizontal header item - solved

2013-03-31 Thread Phil

On 31/03/13 21:43, eryksun wrote:



You can use setHorizontalHeaderItem(0, QTableWidgetItem('col 0'), and
so on. It may be simpler to use setHorizontalHeaderLabels(['col 0',
'col 1', 'etc']).



I have the answer (provided by a member of another list) and I was 
correct, it was something basic.


from PyQt4 import QtGui
QtGui.QTable etc

As I previously said, I had done this under C++ many years ago. The 
Python method is far simpler, especially once you know how.


--
Regards,
Phil
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] is there a simple stand alone python app I can use on my Kindle fire?

2013-03-31 Thread Steven D'Aprano

On 01/04/13 12:18, ah wrote:

Hello,


I'm enjoying learning python, and would like to be able to study and practice 
on the go, using my kindle fire reader. (wifi enabled).


Amazon does have an app, Qpython lite, but requires a  live wifi connection to 
the internet to run. I'm looking for a simple python app, stand alone that i 
can run on my kindle, without an internet connection,  just to practice while i 
learn. (Just a simple terminal, and text editor, and python? like ubuntu 
offers.)



This is a list for learning Python, not the details of arbitrary locked-down 
proprietary platforms. You might be lucky and have a response from somebody who 
knows how to get Python working on a Kindle, but probably not.

Your best bet is to ask on a Kindle forum, or failing that, try on the main 
Python mailing list:

python-l...@python.org

also available on Usenet:

comp.lang.python

Because there are a lot more people on that list, you have a better chance of 
finding someone with a Kindle who knows how to get Python working on it.

The first step should be to try goggling:

https://www.google.com.au/search?q=running+python+on+kindle

If you do get an answer on some other forum, please post the answer here so 
anyone searching the archives will find the answer.



--
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor