comp.lang.python - 26 new messages in 7 topics - digest
comp.lang.python
http://groups.google.com/group/comp.lang.python?hl=en
comp.lang.python@googlegroups.com
Today's topics:
* Trying tcompile an use the Python 3.4a - 7 messages, 5 authors
http://groups.google.com/group/comp.lang.python/t/d6eb7f05008cbf25?hl=en
* Reading c struct via python - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/9036dee94b4a9bff?hl=en
* To whoever hacked into my Database - 10 messages, 9 authors
http://groups.google.com/group/comp.lang.python/t/1459c9bdf9ab0ada?hl=en
* Packing byte fields and an array object into struct - 5 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/5db6286e79bc4516?hl=en
* Oh look, another language (ceylon) - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/aca311b925493f87?hl=en
* Most discussion on comp.lang.python is about developing with Python - 1
messages, 1 author
http://groups.google.com/group/comp.lang.python/t/0d22dd5dd221dc6d?hl=en
* python 2.7.x on MacOSX: failed dlopen() on .so's - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/f7c6dbd1573a9577?hl=en
==============================================================================
TOPIC: Trying tcompile an use the Python 3.4a
http://groups.google.com/group/comp.lang.python/t/d6eb7f05008cbf25?hl=en
==============================================================================
== 1 of 7 ==
Date: Wed, Nov 13 2013 9:45 am
From: Chris "Kwpolska" Warrick
On Wed, Nov 13, 2013 at 5:38 PM, Ferrous Cranus <nikos.gr33k@gmail.com> wrote:
> Στις 13/11/2013 6:13 μμ, ο/η Steven D'Aprano έγραψε:
>
>
>>> and also is there a way to call it like #!/usr/bin/python
>>
>>
>> Of course there is, but only if you wish to break your system. The OS
>> will be expecting /usr/bin/python to be Python 2. Leave it be.
>
>
> Okey i will leave it be although i dislike the idea of using the shebang
> constructor as #~/usr/local/bin/python3
> Is there any way that i can use it as it was #!/usr/bin/python but firing
> python3 instead of python 2.6.6 ?
You can link it to /usr/bin/python3. There should be no problem when
you do this.
> Also i'm tryong 'yum install python-pip' because some modules like 'pymysql'
> and 'pygeoip' are missing but CentOS doesn't seem able to detect it.
That should install it for the Python 2.6.6 you have, and possibly
under the name `python-pip` because of various shenanigans in the
redhatesque repos.
> Please help me install 'pip' so i can install the modules.
http://www.pip-installer.org/en/latest/installing.html#install-or-upgrade-setuptools
Get ez_setup.py and get-pip.py, and run them with the desired Python.
--
Chris "Kwpolska" Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
== 2 of 7 ==
Date: Wed, Nov 13 2013 1:19 pm
From: Ferrous Cranus
Στις 13/11/2013 7:45 μμ, ο/η Chris "Kwpolska" Warrick έγραψε:
> On Wed, Nov 13, 2013 at 5:38 PM, Ferrous Cranus <nikos.gr33k@gmail.com> wrote:
>> Στις 13/11/2013 6:13 μμ, ο/η Steven D'Aprano έγραψε:
>>
>>
>>>> and also is there a way to call it like #!/usr/bin/python
>>>
>>>
>>> Of course there is, but only if you wish to break your system. The OS
>>> will be expecting /usr/bin/python to be Python 2. Leave it be.
>>
>>
>> Okey i will leave it be although i dislike the idea of using the shebang
>> constructor as #~/usr/local/bin/python3
>> Is there any way that i can use it as it was #!/usr/bin/python but firing
>> python3 instead of python 2.6.6 ?
>
> You can link it to /usr/bin/python3. There should be no problem when
> you do this.
>
>> Also i'm tryong 'yum install python-pip' because some modules like 'pymysql'
>> and 'pygeoip' are missing but CentOS doesn't seem able to detect it.
>
> That should install it for the Python 2.6.6 you have, and possibly
> under the name `python-pip` because of various shenanigans in the
> redhatesque repos.
>
>> Please help me install 'pip' so i can install the modules.
>
> http://www.pip-installer.org/en/latest/installing.html#install-or-upgrade-setuptools
>
> Get ez_setup.py and get-pip.py, and run them with the desired Python.
>
Why can't i just use that?
root@secure [~]# sudo yum install python-pip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.plusline.de
* extras: mirror.skylink-datacenter.de
* updates: ftp.plusline.de
base
| 3.7 kB 00:00
extras
| 3.4 kB 00:00
updates
| 3.4 kB 00:00
Setting up Install Process
No package python-pip available.
Error: Nothing to do
root@secure [~]#
'python-pip' is something that all repos should have, why it cannot be
found?
== 3 of 7 ==
Date: Wed, Nov 13 2013 1:30 pm
From: Johannes Findeisen
On Wed, 13 Nov 2013 23:19:53 +0200
Ferrous Cranus wrote:
> Στις 13/11/2013 7:45 μμ, ο/η Chris "Kwpolska" Warrick έγραψε:>
> > Get ez_setup.py and get-pip.py, and run them with the desired Python.
> >
>
>
> Why can't i just use that?
>
> root@secure [~]# sudo yum install python-pip
> Loaded plugins: fastestmirror
> Loading mirror speeds from cached hostfile
> * base: ftp.plusline.de
> * extras: mirror.skylink-datacenter.de
> * updates: ftp.plusline.de
> base
>
>
> | 3.7 kB 00:00
> extras
>
>
> | 3.4 kB 00:00
> updates
>
>
> | 3.4 kB 00:00
> Setting up Install Process
> No package python-pip available.
> Error: Nothing to do
> root@secure [~]#
>
> 'python-pip' is something that all repos should have, why it cannot be
> found?
Please try to figure out your distribution specific stuff by
using a search engine! This was what I found as first result by
searching for "centos pip" at Google:
http://superuser.com/questions/292378/how-to-install-pip-and-easy-install-on-centos
This really is not a Python question but a CentOS issue!
Regards,
Johannes
== 4 of 7 ==
Date: Wed, Nov 13 2013 1:39 pm
From: Ferrous Cranus
Στις 13/11/2013 11:30 μμ, ο/η Johannes Findeisen έγραψε:
> On Wed, 13 Nov 2013 23:19:53 +0200
> Ferrous Cranus wrote:
>
>> Στις 13/11/2013 7:45 μμ, ο/η Chris "Kwpolska" Warrick έγραψε:>
>>> Get ez_setup.py and get-pip.py, and run them with the desired Python.
>>>
>>
>>
>> Why can't i just use that?
>>
>> root@secure [~]# sudo yum install python-pip
>> Loaded plugins: fastestmirror
>> Loading mirror speeds from cached hostfile
>> * base: ftp.plusline.de
>> * extras: mirror.skylink-datacenter.de
>> * updates: ftp.plusline.de
>> base
>>
>>
>> | 3.7 kB 00:00
>> extras
>>
>>
>> | 3.4 kB 00:00
>> updates
>>
>>
>> | 3.4 kB 00:00
>> Setting up Install Process
>> No package python-pip available.
>> Error: Nothing to do
>> root@secure [~]#
>>
>> 'python-pip' is something that all repos should have, why it cannot be
>> found?
>
> Please try to figure out your distribution specific stuff by
> using a search engine! This was what I found as first result by
> searching for "centos pip" at Google:
>
> http://superuser.com/questions/292378/how-to-install-pip-and-easy-install-on-centos
>
> This really is not a Python question but a CentOS issue!
>
> Regards,
> Johannes
>
I have foung this link myself in the morning but it wasnt successfull:
Look:
root@secure [~]# /usr/local/bin/easy_install pip
-bash: /usr/local/bin/easy_install: No such file or directory
root@secure [~]# /usr/bin/easy_install pip
-bash: /usr/bin/easy_install: No such file or directory
If i cannot use 'yum' or even 'easy_setup' how will i install 'pip' and
hence the modules?
== 5 of 7 ==
Date: Wed, Nov 13 2013 1:44 pm
From: Ned Batchelder
On Wednesday, November 13, 2013 4:39:59 PM UTC-5, Ferrous Cranus wrote:
> Στις 13/11/2013 11:30 μμ, ο/η Johannes Findeisen έγραψε:
> > On Wed, 13 Nov 2013 23:19:53 +0200
> > Ferrous Cranus wrote:
> >
> >> Στις 13/11/2013 7:45 μμ, ο/η Chris "Kwpolska" Warrick έγραψε:>
> >>> Get ez_setup.py and get-pip.py, and run them with the desired Python.
> >>>
> >>
> >>
> >> Why can't i just use that?
> >>
> >> root@secure [~]# sudo yum install python-pip
> >> Loaded plugins: fastestmirror
> >> Loading mirror speeds from cached hostfile
> >> * base: ftp.plusline.de
> >> * extras: mirror.skylink-datacenter.de
> >> * updates: ftp.plusline.de
> >> base
> >>
> >>
> >> | 3.7 kB 00:00
> >> extras
> >>
> >>
> >> | 3.4 kB 00:00
> >> updates
> >>
> >>
> >> | 3.4 kB 00:00
> >> Setting up Install Process
> >> No package python-pip available.
> >> Error: Nothing to do
> >> root@secure [~]#
> >>
> >> 'python-pip' is something that all repos should have, why it cannot be
> >> found?
> >
> > Please try to figure out your distribution specific stuff by
> > using a search engine! This was what I found as first result by
> > searching for "centos pip" at Google:
> >
> > http://superuser.com/questions/292378/how-to-install-pip-and-easy-install-on-centos
> >
> > This really is not a Python question but a CentOS issue!
> >
> > Regards,
> > Johannes
> >
>
>
> I have foung this link myself in the morning but it wasnt successfull:
>
> Look:
>
> root@secure [~]# /usr/local/bin/easy_install pip
> -bash: /usr/local/bin/easy_install: No such file or directory
>
> root@secure [~]# /usr/bin/easy_install pip
> -bash: /usr/bin/easy_install: No such file or directory
>
> If i cannot use 'yum' or even 'easy_setup' how will i install 'pip' and
> hence the modules?
Nikos, we've talked about this before. These aren't Python questions. You need to fix your OS. We can't help you with that. I know you are frustrated and want answers, but you can't just post the same question here again and expect a response. You need to solve this some other way.
Asking over and over again will simply cause another fight on this list, and no one wants that. Find another way to solve your problem.
--Ned.
== 6 of 7 ==
Date: Wed, Nov 13 2013 1:52 pm
From: Ferrous Cranus
Στις 13/11/2013 11:44 μμ, ο/η Ned Batchelder έγραψε:
> On Wednesday, November 13, 2013 4:39:59 PM UTC-5, Ferrous Cranus wrote:
>> Στις 13/11/2013 11:30 μμ, ο/η Johannes Findeisen έγραψε:
>>> On Wed, 13 Nov 2013 23:19:53 +0200
>>> Ferrous Cranus wrote:
>>>
>>>> Στις 13/11/2013 7:45 μμ, ο/η Chris "Kwpolska" Warrick έγραψε:>
>>>>> Get ez_setup.py and get-pip.py, and run them with the desired Python.
>>>>>
>>>>
>>>>
>>>> Why can't i just use that?
>>>>
>>>> root@secure [~]# sudo yum install python-pip
>>>> Loaded plugins: fastestmirror
>>>> Loading mirror speeds from cached hostfile
>>>> * base: ftp.plusline.de
>>>> * extras: mirror.skylink-datacenter.de
>>>> * updates: ftp.plusline.de
>>>> base
>>>>
>>>>
>>>> | 3.7 kB 00:00
>>>> extras
>>>>
>>>>
>>>> | 3.4 kB 00:00
>>>> updates
>>>>
>>>>
>>>> | 3.4 kB 00:00
>>>> Setting up Install Process
>>>> No package python-pip available.
>>>> Error: Nothing to do
>>>> root@secure [~]#
>>>>
>>>> 'python-pip' is something that all repos should have, why it cannot be
>>>> found?
>>>
>>> Please try to figure out your distribution specific stuff by
>>> using a search engine! This was what I found as first result by
>>> searching for "centos pip" at Google:
>>>
>>> http://superuser.com/questions/292378/how-to-install-pip-and-easy-install-on-centos
>>>
>>> This really is not a Python question but a CentOS issue!
>>>
>>> Regards,
>>> Johannes
>>>
>>
>>
>> I have foung this link myself in the morning but it wasnt successfull:
>>
>> Look:
>>
>> root@secure [~]# /usr/local/bin/easy_install pip
>> -bash: /usr/local/bin/easy_install: No such file or directory
>>
>> root@secure [~]# /usr/bin/easy_install pip
>> -bash: /usr/bin/easy_install: No such file or directory
>>
>> If i cannot use 'yum' or even 'easy_setup' how will i install 'pip' and
>> hence the modules?
>
> Nikos, we've talked about this before. These aren't Python questions. You need to fix your OS. We can't help you with that. I know you are frustrated and want answers, but you can't just post the same question here again and expect a response. You need to solve this some other way.
>
> Asking over and over again will simply cause another fight on this list, and no one wants that. Find another way to solve your problem.
>
> --Ned.
>
If i knew how to solve this Ned i wouldn't be asking you. My provider
haven't replied back to me.
Actually it is a python question regarding a python installation issue.
Is it so much trouble to help me with this?
== 7 of 7 ==
Date: Wed, Nov 13 2013 1:56 pm
From: Mark Lawrence
On 13/11/2013 21:39, Ferrous Cranus wrote:
> Στις 13/11/2013 11:30 μμ, ο/η Johannes Findeisen έγραψε:
>> On Wed, 13 Nov 2013 23:19:53 +0200
>> Ferrous Cranus wrote:
>>
>>> Στις 13/11/2013 7:45 μμ, ο/η Chris "Kwpolska" Warrick έγραψε:>
>>>> Get ez_setup.py and get-pip.py, and run them with the desired Python.
>>>>
>>>
>>>
>>> Why can't i just use that?
>>>
>>> root@secure [~]# sudo yum install python-pip
>>> Loaded plugins: fastestmirror
>>> Loading mirror speeds from cached hostfile
>>> * base: ftp.plusline.de
>>> * extras: mirror.skylink-datacenter.de
>>> * updates: ftp.plusline.de
>>> base
>>>
>>>
>>> | 3.7 kB 00:00
>>> extras
>>>
>>>
>>> | 3.4 kB 00:00
>>> updates
>>>
>>>
>>> | 3.4 kB 00:00
>>> Setting up Install Process
>>> No package python-pip available.
>>> Error: Nothing to do
>>> root@secure [~]#
>>>
>>> 'python-pip' is something that all repos should have, why it cannot be
>>> found?
>>
>> Please try to figure out your distribution specific stuff by
>> using a search engine! This was what I found as first result by
>> searching for "centos pip" at Google:
>>
>> http://superuser.com/questions/292378/how-to-install-pip-and-easy-install-on-centos
>>
>>
>> This really is not a Python question but a CentOS issue!
>>
>> Regards,
>> Johannes
>>
>
>
> I have foung this link myself in the morning but it wasnt successfull:
>
> Look:
>
> root@secure [~]# /usr/local/bin/easy_install pip
> -bash: /usr/local/bin/easy_install: No such file or directory
>
> root@secure [~]# /usr/bin/easy_install pip
> -bash: /usr/bin/easy_install: No such file or directory
>
> If i cannot use 'yum' or even 'easy_setup' how will i install 'pip' and
> hence the modules?
>
I really don't believe this, 24 lines above this one is the link to a
page telling you how to do it, but you're *STILL* asking!!! What do you
want, jam on it???
--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer
Mark Lawrence
==============================================================================
TOPIC: Reading c struct via python
http://groups.google.com/group/comp.lang.python/t/9036dee94b4a9bff?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Nov 13 2013 9:59 am
From: "Lakshmipathi.G"
> Looks like your "e"... Is that the key field?
Yes, you are right 'e' is the key. And rest of them are data.
>AND the order of the items is "o" before "i"
>-- that doesn't seem to match your C struct definition.
Sorry, I was testing the bdb and while doing that I noticed,
c-struct order is not same as inserted bdb record . But forgot to
fix the struct order before posting it here.
(And also I didn't expect someone will dig this deeper on the binary
string output :p . Thanks for your effort! )
>"s" format in which you precode the length of the string in the
>format ("10s" is a 10 character string), and "p" format in which the first
>byte of the string is the length (0..255) of the rest of the string. The
>struct module doesn't handle C-type null terminated strings directly.
I think we can use 'p' format. (Thus storing the string-length before
actual
string content). That should help us unpack easily.
Thanks Dennis Lee Bieber, for the detailed info and step by step parsing
of the output. It really helped.
--
> Wulfraed Dennis Lee Bieber AF6VN
> wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
----
Cheers,
Lakshmipathi.G
FOSS Programmer.
www.giis.co.in
==============================================================================
TOPIC: To whoever hacked into my Database
http://groups.google.com/group/comp.lang.python/t/1459c9bdf9ab0ada?hl=en
==============================================================================
== 1 of 10 ==
Date: Wed, Nov 13 2013 10:11 am
From: Antoon Pardon
Op 13-11-13 15:10, Ian Kelly schreef:
>> Well you can expect all you want. It is not going to happen. Your
>> expectations are completely unrealistic and the way you react will
>> be perceived by a number of people as just an attempt to getting those
>> that are frustrated silenced without much care about what caused those
>> frustrations.
>
> There is absolutely nothing that I can do about what caused those
> frustrations, so what practical difference does it make whether I care
> or not?
If you want to persuade people to change their behaviour, it matters
very much if you can show them you care.
>> It looks like in your world you have a very limited idea of how adults
>> behave. Expecting the others to behave like adults has often enough
>> been the strategy of the priveledged to ignore justified frustration.
>
> Nobody is being disenfranchised here. If you want to make this about
> privilege, then I will just say that I think it is the height of
> privilege to be fussing over the fact that there are people who annoy
> you on the internet, and moreover doing so to the detriment of the
> community.
Is it? Then why are you fussing here? Why don't you address the spoon
feeders who frustrate other group members to the detriment of the community.
>> It is a win either way. If the frustration is uttered in an adult,
>> mature way it doesn't cause much discomfort and is easily ignored. So
>> when those who are frustrated see that being adult and mature doesn't
>> get them much and start reacting a bit less adultly and maturely the
>> frustration can now be dismissed as not being done in an adult and
>> mature way.
>>
>> That is your goal here too. You are not interested in the frustrations
>> of a number of people. You just want to be able to ignore there are
>> frustrated people on the news group.
>
> It's not about me at all. If it were, I would be more likely to just
> unsubscribe than to raise a fuss about it. It's also not about you,
> and it's not even about Nikos. What it is about is that this crap
> about Nikos is often the first thing that newcomers will see when they
> join this group.
So? If this wasn't about you, this just wouldn't make a difference to
you.
> You seem very concerned in your posts about what
> kind of message I'm sending by what I choose to respond to.
Just making sure you were aware of that aspect as the rest of your contribution
strongly suggested you were not.
> Well,
> think about what kind of message it sends to a new user when their
> introduction to the group -- which is supposedly about Python -- is a
> lot of flaming directed at some poster whom they know nothing about.
Well one message obviously is that it is possible to annoy the regulars to
the point that they start flaming you. I don't think that is bad.
> You keep trying to cast certain people who are frustrated by Nikos as
> victims in all this, but they're not. I think that all who have
> posted in this thread, and many who haven't, are probably all
> frustrated in one way or another by all this -- I know that I
> certainly am. The victims are the community as a whole,
The community as a whole suffers when its members get frustrated and
one part of the community telling the other part to just deal with
it is no way to turn the community into something welcoming again and
is IMO more detrimental to the community than a number of people
venting their frustration.
You expect those that get frustrated to tolerate Nikos and to tolerate
the spoon feeding, but you are unable to tolerate the venting of
frustrations.
> and anybody
> who decides not to join because they see this fracas and decide to
> seek out a more inviting forum.
Why would they be a victim? What is there to be victim about seeking
out a more inviting forum? I also think you are confusing a welcome
community with a community without conflict.
> Here's my plea to everybody, in a nutshell. Remember that the name of
> this group is comp.lang.python. It's *not*
> alt.misc.flame.trolls.nikos.sucks.
It is also not alt.misc.keep.spoon.feeding.nikos.
> The topic here is Python, and if
> you want to talk about that, then welcome and please do. If on the
> other hand you just want to vent your frustration, then find somewhere
> else to do it. Please.
But if you want to spoon feed a help vampire to the detriment of the
group you can go right ahead?
--
Antoon Pardon
== 2 of 10 ==
Date: Wed, Nov 13 2013 10:27 am
From: superchromix
hi all,
I've been thinking about learning Python for scientific programming.. but all of these flame war type posts make the user community look pretty lame. How did all of these nice packages get written when most of the user interaction is .... this??
Can anyone tell me, is there another newsgroup where the discussion is more on python programming?
thanks
== 3 of 10 ==
Date: Wed, Nov 13 2013 10:30 am
From: Ned Batchelder
On Wednesday, November 13, 2013 1:27:39 PM UTC-5, superchromix wrote:
> hi all,
>
> I've been thinking about learning Python for scientific programming.. but all of these flame war type posts make the user community look pretty lame. How did all of these nice packages get written when most of the user interaction is .... this??
>
> Can anyone tell me, is there another newsgroup where the discussion is more on python programming?
>
> thanks
I apologize for all of the flame wars. All online communities have to deal with negative forces in their midst, and we are no exception. It doesn't always go smoothly.
Please start a new thread with your question about scientific programming. I promise it won't go badly.
--Ned.
== 4 of 10 ==
Date: Wed, Nov 13 2013 10:47 am
From: lconrad@go2france.com
On Wednesday 13/11/2013 at 12:31 pm, superchromix wrote:
>
>
> hi all,
>
> I've been thinking about learning Python for scientific programming..
> but all of these flame war type posts make the user community look
> pretty lame. How did all of these nice packages get written when most
> of the user interaction is .... this??
>
> Can anyone tell me, is there another newsgroup where the discussion is
> more on python programming?
"most of the user interaction is .... this??"
LOL
hope your problem and code analysis is better than your social
analysis
== 5 of 10 ==
Date: Wed, Nov 13 2013 11:02 am
From: Steve Simmons
On 13/11/2013 19:27, superchromix wrote:
>
> hi all,
>
> I've been thinking about learning Python for scientific programming.. but all of these flame war type posts make the user community look pretty lame. How did all of these nice packages get written when most of the user interaction is .... this??
>
> Can anyone tell me, is there another newsgroup where the discussion is more on python programming?
>
> thanks
Sadly, I'm inclined to agree with you but this is a relatively recent
development.
I joined this group about a year ago and, while it wasn't all 'sweetness
and light', it was a lot better than '. . . . this' - in fact I'd say it
was pretty good, I certainly got treated well and got quality answers to
my (few) questions. Right now, we have a 'help vampire' who has
demanded an inordinate amount of time from the list members - and not in
a polite or well structured way. The members of this list have
responded in various ways, ranging from continuing to help through to
kill-file on the offending person. The discourse around how to deal with
this issue has degenerated into some unfortunate and vitriolic debate.
As far as I can see, it remains possible to post sensible, well
constructed questions and get sensible well-considered answers - just
let the intense arguments pass you by and focus on your own issues and
their resolutions and you'll be fine on this list. There are plenty of
very capable Pythonistas ready to help.
Some basic advice (not wanting to teach you to suck eggs):
- Include relevant info on your environment (OS; version of Python; any
specialist libraries in use; etc)
- Come to the list with a clear description of what you are trying to do
- Preferably include a code sample that displays the problem
- Include the trace-back if you are getting one
- Try to avoid using Google Groups as your 'reader'
Welcome! Ignore the BS and Enjoy :-)
Steve S
== 6 of 10 ==
Date: Wed, Nov 13 2013 11:24 am
From: Zachary Ware
On Wed, Nov 13, 2013 at 12:27 PM, superchromix <markb77@gmail.com> wrote:
>
>
> hi all,
>
> I've been thinking about learning Python for scientific programming.. but all of these flame war type posts make the user community look pretty lame. How did all of these nice packages get written when most of the user interaction is .... this??
>
> Can anyone tell me, is there another newsgroup where the discussion is more on python programming?
Please don't judge the whole community by this thread, I promise we're
not all bad! The majority of the traffic on this list is of a useful
sort, and you can learn fairly quickly the addresses that are best
ignored, blocked, or otherwise passed over. For myself using Gmail, I
have a filter set up to mark particular threads that I don't want to
be notified about and mute them after the first few mails come in. I
didn't see your message initially because it was part of a muted
thread, I only saw it at all because the thread spilled over the 100
message mark into a "new" thread in Gmail with one of the replies to
your message.
Also, if you have a specific question about how to do something in
Python you can try the tutor list (tutor@python.org) which is much
more focused, much lower traffic, and has several very knowledgeable
Pythonistas listening in.
Give us a chance, and I don't think we'll let you down :)
--
Zach
== 7 of 10 ==
Date: Wed, Nov 13 2013 11:36 am
From: Oscar Benjamin
On Nov 13, 2013 6:31 PM, "superchromix" <markb77@gmail.com> wrote:
>
> I've been thinking about learning Python for scientific programming.. but
all of these flame war type posts make the user community look pretty lame.
How did all of these nice packages get written when most of the user
interaction is .... this??
This isn't usually what happens on this list. Most people on this list
(myself included) are ignoring or at least not contributing to these
particular threads.
>
> Can anyone tell me, is there another newsgroup where the discussion is
more on python programming?
For a beginner I would certainly recommend the python-tutor list. I've
never seen a flame war there. Threads tend to stay on-topic and are usually
helpful to the OP. The tutor list is for generic python problems but you
can usually get help for simple scientific programming problems.
https://mail.python.org/mailman/listinfo/tutor
Oscar
== 8 of 10 ==
Date: Wed, Nov 13 2013 12:11 pm
From: William Ray Wing
On Nov 13, 2013, at 1:27 PM, superchromix <markb77@gmail.com> wrote:
>
>
> hi all,
>
> I've been thinking about learning Python for scientific programming.. but all of these flame war type posts make the user community look pretty lame. How did all of these nice packages get written when most of the user interaction is .... this??
>
> Can anyone tell me, is there another newsgroup where the discussion is more on python programming?
>
> thanks
> --
> https://mail.python.org/mailman/listinfo/python-list
I'd like to add one final thought to the note about joining the python-tutor list.
For scientific programming you are almost certainly going to want to learn about scipy, numpy and matplotlib.
These specialized libraries have dedicated discussion groups, which can be found at: <numpy-discussion@scipy.org>, and <matplotlib-users@lists.sourceforge.net>
I'd recommend looking over the material at
http://www.scipy.org
Welcome to the community.
-Bill
== 9 of 10 ==
Date: Wed, Nov 13 2013 1:46 pm
From: Ferrous Cranus
root@secure:~/lib64# ls -al | grep libkey
lrwxrwxrwx 1 root root 20 Jun 22 2012 libkeyutils.so.1 ->
libkeyutils.so.1.3.0*
-rwxr-xr-x 1 root root 10192 Jun 22 2012 libkeyutils.so.1.3*
-rwxr-xr-x 1 root root 32920 Jun 22 2012 libkeyutils.so.1.3.0*
root@secure:~/lib64# rpm -qf libkeyutils.so.1.3.0
file /lib64/libkeyutils.so.1.3.0 is not owned by any package
================================
It appears that my server has been compromised with a malicious payload
designed to sniff for and steal server passwords.
This must have happened when i was handling my root passwords out in the
open.
Served me well.
== 10 of 10 ==
Date: Wed, Nov 13 2013 1:52 pm
From: Ned Batchelder
On Wednesday, November 13, 2013 4:46:59 PM UTC-5, Ferrous Cranus wrote:
> root@secure:~/lib64# ls -al | grep libkey
>
> lrwxrwxrwx 1 root root 20 Jun 22 2012 libkeyutils.so.1 ->
> libkeyutils.so.1.3.0*
> -rwxr-xr-x 1 root root 10192 Jun 22 2012 libkeyutils.so.1.3*
> -rwxr-xr-x 1 root root 32920 Jun 22 2012 libkeyutils.so.1.3.0*
>
> root@secure:~/lib64# rpm -qf libkeyutils.so.1.3.0
> file /lib64/libkeyutils.so.1.3.0 is not owned by any package
>
> ================================
>
> It appears that my server has been compromised with a malicious payload
> designed to sniff for and steal server passwords.
>
> This must have happened when i was handling my root passwords out in the
> open.
>
> Served me well.
This has nothing to do with the topic of this mailing list. Please don't post it here.
--Ned.
==============================================================================
TOPIC: Packing byte fields and an array object into struct
http://groups.google.com/group/comp.lang.python/t/5db6286e79bc4516?hl=en
==============================================================================
== 1 of 5 ==
Date: Wed, Nov 13 2013 10:31 am
From: krishna2prasad@gmail.com
Hello,
I am trying to build a structure to be passed down to an I2C device driver. The driver expects a struct that has a data array of size 512 bytes among other things. This is my code -
rd_wr = 0x0 # Read operation
i2c_addr = addr
mux = mux_sel
multi_len = count
cmd = 0x0
i2c_inst_type = CHEL_I2C_AUTO_RD_TYPE_5
flag = CHEL_I2C_AUTO_VALID
status = 0x0
data = array.array('B', (0 for x in range(0,512)))
os_inst_bytes = (struct.pack('B', rd_wr) +
struct.pack('B', i2c_addr) +
struct.pack('B', mux) +
struct.pack('B', multi_len) +
struct.pack('B', cmd) +
struct.pack('B', i2c_inst_type) +
struct.pack('B', flag) +
struct.pack('I', status) +
struct.pack('512B', data))
#Convert to byte array
os_inst = bytearray(os_inst_bytes)
ret = fcntl.ioctl(self._dev_fd,
self.__IOWR(FXCB_FPGAIO_I2C_AUTO_OS_INST),
os_inst, 1)
I get an error like this -
591 struct.pack('B', flag) +
592 struct.pack('I', status) +
--> 593 struct.pack('512B', data))
error: pack requires exactly 512 arguments
In [1]:
Even though data is a 512 element array, it is not treat as such in this struct.pack. The data field is used to return data from the driver. I should be able to unpack the struct os_inst and read the data buffer after the IOCTL call. How can I achieve this ?
Thanks in advance!
== 2 of 5 ==
Date: Wed, Nov 13 2013 10:44 am
From: Ned Batchelder
On Wednesday, November 13, 2013 1:31:49 PM UTC-5, krishna...@gmail.com wrote:
> Hello,
>
> I am trying to build a structure to be passed down to an I2C device driver. The driver expects a struct that has a data array of size 512 bytes among other things. This is my code -
>
> rd_wr = 0x0 # Read operation
> i2c_addr = addr
> mux = mux_sel
> multi_len = count
> cmd = 0x0
> i2c_inst_type = CHEL_I2C_AUTO_RD_TYPE_5
> flag = CHEL_I2C_AUTO_VALID
> status = 0x0
> data = array.array('B', (0 for x in range(0,512)))
>
> os_inst_bytes = (struct.pack('B', rd_wr) +
> struct.pack('B', i2c_addr) +
> struct.pack('B', mux) +
> struct.pack('B', multi_len) +
> struct.pack('B', cmd) +
> struct.pack('B', i2c_inst_type) +
> struct.pack('B', flag) +
> struct.pack('I', status) +
> struct.pack('512B', data))
>
> #Convert to byte array
> os_inst = bytearray(os_inst_bytes)
>
> ret = fcntl.ioctl(self._dev_fd,
> self.__IOWR(FXCB_FPGAIO_I2C_AUTO_OS_INST),
> os_inst, 1)
>
> I get an error like this -
>
> 591 struct.pack('B', flag) +
> 592 struct.pack('I', status) +
>
> --> 593 struct.pack('512B', data))
>
> error: pack requires exactly 512 arguments
>
> In [1]:
>
> Even though data is a 512 element array, it is not treat as such in this struct.pack. The data field is used to return data from the driver. I should be able to unpack the struct os_inst and read the data buffer after the IOCTL call. How can I achieve this ?
>
> Thanks in advance!
To make a 512-byte field in struct, use '512s' with a data value of ''. It will zero-pad the result and give you 512 zero bytes. Also, you can use multiple format specifiers in one struct.pack call:
os_inst_bytes = struct.pack('7BI512s', rd_wr, i2c_addr, muc, multi_len, cmd, i2c_inst_type, flag, status, '')
Lastly, I suspect the value returned from struct.pack is byte-string enough for the ioctl call, no need to use bytearray.
--Ned.
== 3 of 5 ==
Date: Wed, Nov 13 2013 12:41 pm
From: krishna2prasad@gmail.com
Thanks for your reply Ned!
I tried this your suggestion and this is what it complains...
os_inst_bytes = struct.pack('7BI512s', 0, 0x51, 0x10, 5, 0, 0xD, 0x80, 0, '')
---------------------------------------------------------------------------
error
Traceback (most recent call last)
<ipython-input-6-d36f45a8d3e6> in <module>()
----> 1 os_inst_bytes = struct.pack('7BI512s', 0, 0x51, 0x10, 5, 0, 0xD, 0x80, 0, "")
error: argument for 's' must be a bytes object
In [7]:
And about the bytearray() call, I want to pass a mutable object to the IOCTL to be able to get the data back from the driver. Without bytearray(), the ioctl with mutable flag set to 1 would complain.
I tried to use the p format specifier with pack after converting the array object to byte stream. Packing seems fine. However, I cant seem to unpack.
In [1]: import array
In [2]: import struct
In [3]: data = array.array('B', (1 for x in range(5)))
In [4]: data_bytes = data.tobytes()
In [5]: os_inst_bytes = struct.pack('7BIp', 0, 0x51, 0x10, 5, 0, 0xD, 0x80, 0, data_bytes)
In [6]:
In [6]: os_inst = bytearray(os_inst_bytes)
In [7]: result = struct.unpack('7B', os_inst[0:7])
In [8]: print(result)
(0, 81, 16, 5, 0, 13, 128)
In [9]: result = struct.unpack('I', os_inst[7:11])
In [10]: print(result)
(0,)
In [11]: result = struct.unpack('5s', os_inst[11:16])
---------------------------------------------------------------------------
error Traceback (most recent call last)
<ipython-input-11-da14a6693435> in <module>()
----> 1 result = struct.unpack('5s', os_inst[11:16])
error: unpack requires a bytes object of length 5
In [12]:
== 4 of 5 ==
Date: Wed, Nov 13 2013 12:43 pm
From: krishna2prasad@gmail.com
Correction in the last input line...
In [16]: result = struct.unpack('5p', os_inst[11:16])
---------------------------------------------------------------------------
error Traceback (most recent call last)
<ipython-input-16-42b59e00d5af> in <module>()
----> 1 result = struct.unpack('5p', os_inst[11:16])
error: unpack requires a bytes object of length 5
In [17]:
== 5 of 5 ==
Date: Wed, Nov 13 2013 12:47 pm
From: Ned Batchelder
On Wednesday, November 13, 2013 3:41:03 PM UTC-5, krishna...@gmail.com wrote:
> Thanks for your reply Ned!
>
> I tried this your suggestion and this is what it complains...
>
> os_inst_bytes = struct.pack('7BI512s', 0, 0x51, 0x10, 5, 0, 0xD, 0x80, 0, '')
>
> ---------------------------------------------------------------------------
> error
> Traceback (most recent call last)
> <ipython-input-6-d36f45a8d3e6> in <module>()
> ----> 1 os_inst_bytes = struct.pack('7BI512s', 0, 0x51, 0x10, 5, 0, 0xD, 0x80, 0, "")
>
> error: argument for 's' must be a bytes object
>
OK, looks like you are using Python 3 (it helps to specify these things up-front). Use b"" to get an empty byte-string.
> In [7]:
>
>
> And about the bytearray() call, I want to pass a mutable object to the IOCTL to be able to get the data back from the driver. Without bytearray(), the ioctl with mutable flag set to 1 would complain.
OK, keep the bytearray call if it helps.
--Ned.
==============================================================================
TOPIC: Oh look, another language (ceylon)
http://groups.google.com/group/comp.lang.python/t/aca311b925493f87?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Nov 13 2013 11:33 am
From: Neal Becker
http://ceylon-lang.org/documentation/1.0/introduction/
==============================================================================
TOPIC: Most discussion on comp.lang.python is about developing with Python
http://groups.google.com/group/comp.lang.python/t/0d22dd5dd221dc6d?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Nov 13 2013 12:35 pm
From: bob gailer
I joined a week or so ago.
The subject line was copied from the description of comp.lang.python aka
python-list@python.org.
I am very disappointed to see so much energy and bandwidth going to
conversations that bash individuals.
Is there a moderator for this list?
Is there some other place for discussions that are completely OT and
also full of flames?
Or would you be willing to stop the bashing? I don't see that it helps
anyone, and could be very offputting to other newbies.
I hope and pray that there will be a few simple answers. The last thing
I want is to start another flame war.
Thanks for hearing me.
--
Bob Gailer
919-636-4239
Chapel Hill NC
==============================================================================
TOPIC: python 2.7.x on MacOSX: failed dlopen() on .so's
http://groups.google.com/group/comp.lang.python/t/f7c6dbd1573a9577?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Nov 13 2013 11:16 am
From: Paul Smith
Hi all. I need to build my own version of Python on a MacOSX system,
and I can't seem to do it successfully. I need to build it with a
particular location, etc. and so I can't use Homebrew or whatever: I
need to compile it myself from the source tarball. I did look through
the Homebrew recipe and I don't see anything that seems like it would
help with my problem.
I'm using MacOSX 10.7.5 with xcode 4.1, containing gcc 4.2.1 / clang 2.1
(configure seems to choose gcc).
I've tried this with both Python 2.7.5 and 2.7.6. I get the tarball,
unpack it, then:
$ configure --prefix=/Users/build/python
$ make
$ make install
$ export PATH=/Users/build/python/bin:$PATH
$ export PYTHONHOME=/Users/build/python
$ python2.7 --version
Python 2.7.6
Simple scripts seem to work fine. But then I need to install various
packages; for example pycrypto. When I try to build that it fails to
build:
$ cd src/pycrypto-2.6 && python2.7 setup.py build
Traceback (most recent call last):
File "setup.py", line 45, in <module>
import struct
File "/Users/build/python/lib/python2.7/struct.py", line 1, in <module>
from _struct import *
ImportError: dlopen(/Users/build/python/lib/python2.7/lib-dynload/_struct.so, 2): Symbol not found: _PyObject_Free
Referenced from: /Users/build/python/lib/python2.7/lib-dynload/_struct.so
Expected in: dynamic lookup
This happens with every module that is not pure-Python: boto, paramiko,
etc.
Looking at the various python2.7/lib-dynload/*.so files with nm I see
that actually a number of them refer to an unresolved ("U") symbol
_PyObject_Free (and other _PyObject_* symbols). I can't find any shared
library being built by the python build (.dylib or .so or whatever);
there's just a libpython2.7.a file (I tried forcing --enable-shared on
the configure line and it didn't change anything).
I should say that I've used this same configuration and set of steps,
etc. on my GNU/Linux system and it worked perfectly.
==============================================================================
You received this message because you are subscribed to the Google Groups "comp.lang.python"
group.
To post to this group, visit http://groups.google.com/group/comp.lang.python?hl=en
To unsubscribe from this group, send email to comp.lang.python+unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.python/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com/?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home