Re: Embedding a for inside an html template for substitution

2013-03-04 Thread nagia . retsina
Τη Δευτέρα, 4 Μαρτίου 2013 5:14:00 μ.μ. UTC+2, ο χρήστης Νίκος Γκρ33κ έγραψε: > Hello pythonistas! > > > > I'am tryign to populate a table with dictionary keys and values: > > > > Foe that iam using an html template and the questions is what i should write > inside 'files.html' so then then

Re: Pythonic way for retrieving value for a nested dictionary.

2013-03-04 Thread Dave Angel
On 03/05/2013 01:48 AM, Lowly Minion wrote: For a typical dict: i.e. d = { '1': 'a', '2', 'b' } I might use something like: d.get('1', None) To get the value of 1. What would be the most pythonic way of getting a nested value of a dictionary within a list: some_list = [{ 'item': { 'letter'

Re: Python SUDS issue

2013-03-04 Thread dieter
VGNU Linux writes: > ... > Here is my code: > from suds.client import Client > wsdlurl = 'https://46.51.221.138/PBExternalServices/v1/soap?wsdl' > client = Client(wsdlurl) > print client > > And following is the error that occurs on trying to print client. > Traceback (most recent call last): > .

Pythonic way for retrieving value for a nested dictionary.

2013-03-04 Thread Lowly Minion
For a typical dict: i.e. d = { '1': 'a', '2', 'b' } I might use something like: d.get('1', None) To get the value of 1. What would be the most pythonic way of getting a nested value of a dictionary within a list: some_list = [{ 'item': { 'letter': 'b', 'wor

Re: Python SUDS issue

2013-03-04 Thread VGNU Linux
Hi, Typing URL in the browser displays document tree as a web page. Is it right or there is something wrong with it ? Regards, VGNU On Mon, Mar 4, 2013 at 6:45 PM, Joel Goldstick wrote: > > > > On Mon, Mar 4, 2013 at 5:37 AM, VGNU Linux wrote: > >> Hi Guys, >> I am pretty new to web services.

Re: [Python-ideas] string.format() default variable assignment

2013-03-04 Thread Gene Heskett
On Monday 04 March 2013 23:00:31 Chris Angelico did opine: > On Tue, Mar 5, 2013 at 1:42 PM, Steven D'Aprano > > wrote: > > It's easy for him to > > deal with it, all he has to do is get a goat to eat the garden waste I > > toss over the fence, and his problem is solved. > > Sounds like someone

Re: Embedding a for inside an html template for substitution

2013-03-04 Thread Michael Torrie
On 03/04/2013 01:06 PM, Ferrous Cranus wrote: > What do you advise me to do? > Generate html via python code like print '''stuf..''' or use an > html templating system? > Up until now i was using the first method and i though it would be a > nice idea to seperate design from code. > > But p

** UPDATE ** ~ The Perfect Guide To Actionable Programming & Thank You ~

2013-03-04 Thread Claira
Thanks for the few answers, though those few were very Helpful. The problem was that some people (even after 4 or more years of university), especially including almost all beginners, do not know how to start building something that does something helpful for soceity and everyone around them -- and

Re: Python script not working on windows 7 but works fine on linux

2013-03-04 Thread 88888 Dihedral
On Tuesday, March 5, 2013 3:20:28 AM UTC+8, ian douglas wrote: > On 03/04/2013 11:06 AM, io wrote: > > > esclusioni_file = open('/home/io/btc_trading/exclusions.txt','r') > > > > > > Windows error : > > > > > > Traceback (most recent call last): > > >File "C:\btc_trading\scripts > > > \i

Re: [Python-ideas] string.format() default variable assignment

2013-03-04 Thread Chris Angelico
On Tue, Mar 5, 2013 at 1:42 PM, Steven D'Aprano wrote: > It's easy for him to > deal with it, all he has to do is get a goat to eat the garden waste I > toss over the fence, and his problem is solved. Sounds like someone got Steven's goat. *dives for cover* ChrisA -- http://mail.python.org/mai

Re: [Python-ideas] string.format() default variable assignment

2013-03-04 Thread Steven D'Aprano
On Mon, 04 Mar 2013 11:09:10 -0500, David Robinow wrote: > But here's what I don't understand. Why does somebody who posts as > much as Steven (and thanks for that. Getting cussed at occasionally is a > cheap price for all the free advice) not set up a simple mail filter > which trashes all mail

Re: Python script not working on windows 7 but works fine on linux

2013-03-04 Thread Andrew Berg
On 2013.03.04 19:58, Steven D'Aprano wrote: > Windows understands forward slashes in paths too. You can make your code > (almost) platform-independent, and avoid a lot of problems with unescaped > backslashes, by always using forward slashes in paths. Or use os.path.join, the entire purpose of wh

Re: Python script not working on windows 7 but works fine on linux

2013-03-04 Thread Steven D'Aprano
On Mon, 04 Mar 2013 11:20:28 -0800, ian douglas wrote: > The error tells you everything you need to know: the file system has no > path/file called "/home/io/btc_trading/markets.csv" > > I imagine your CSV file lives in a different location on your Windows 7 > system (which also uses back-slashes

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-03-04 Thread Steven D'Aprano
On Mon, 04 Mar 2013 16:36:36 +, Grant Edwards wrote: > On 2013-02-28, kramer65 wrote: > >> I'm using Python for a while now and I love it. There is just one thing >> I cannot understand. There are compilers for languages like C and C++. >> why is it impossible to create a compiler that can c

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-03-04 Thread Benjamin Kaplan
On Mar 4, 2013 3:02 PM, "CM" wrote: > > > > The main issue is that python has dynamic typing. The type of object > > that is referenced by a particular name can vary, and there's no way > > (in general) to know at compile time what the type of object "foo" is. > > > > That makes generating object

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-03-04 Thread Chris Angelico
On Tue, Mar 5, 2013 at 9:55 AM, CM wrote: > >> The main issue is that python has dynamic typing. The type of object >> that is referenced by a particular name can vary, and there's no way >> (in general) to know at compile time what the type of object "foo" is. >> >> That makes generating object

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-03-04 Thread Terry Reedy
On 3/4/2013 5:55 PM, CM wrote: Could you help me understand this better? For example, if you have this line in the Python program: foo = 'some text' bar = {'apple':'fruit'} If the interpreter can determine at runtime that foo is a string and bar is a dict, why can't the compiler figure that o

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-03-04 Thread 88888 Dihedral
On Tuesday, March 5, 2013 6:55:06 AM UTC+8, CM wrote: > > The main issue is that python has dynamic typing.  The type of object > > > that is referenced by a particular name can vary, and there's no way > > > (in general) to know at compile time what the type of object "foo" is. > > > > > > Tha

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-03-04 Thread CM
> The main issue is that python has dynamic typing.  The type of object > that is referenced by a particular name can vary, and there's no way > (in general) to know at compile time what the type of object "foo" is. > > That makes generating object code to manipulate "foo" very difficult. Could y

فيس بوك facebook

2013-03-04 Thread 23alagmy
فيس بوك facebook https://www.facebook.com/pages/%D9%86%D8%AA%D8%A7%D8%A6%D8%AC-%D8%A7%D9%84%D8%A7%D9%85%D8%AA%D8%AD%D8%A7%D9%86%D8%A7%D8%AA-%D9%88%D8%A7%D9%84%D8%AC%D8%A7%D9%85%D8%B9%D8%A7%D8%AA-%D9%88%D8%A7%D8%AC%D8%AA%D9%85%D8%A7%D8%B9%D9%8A%D8%A7%D8%AA/299719160065550?ref=hl -- http://mail.pyt

Re: How to Nest Structs?

2013-03-04 Thread web
Try unpacking the nested struct as a fixed width string and then unpacking the string. Then unpack the string On Monday, March 4, 2013 10:22:07 AM UTC-8, Ari King wrote: > Hi, > > > > I'm trying to nest the "info_header", "info_body", and "info_trailer" structs > (see below) into a "data_

Re: Python script not working on windows 7 but works fine on linux

2013-03-04 Thread Terry Reedy
On 3/4/2013 2:20 PM, ian douglas wrote: I imagine your CSV file lives in a different location on your Windows 7 system (which also uses back-slashes '\' instead of forward-slashes '/', Forward slashes work fine on Windows except for invoking the executable at a Command Prompt command line, wh

Re: Python script not working on windows 7 but works fine on linux

2013-03-04 Thread Chris Angelico
On Tue, Mar 5, 2013 at 6:59 AM, io wrote: > Genius! > > The code i posted was an example. > My real code was c:\btc_trading > > i was just missing the double slashes! > > Thanks , thankyou very much. > > :-) Even on Windows, you can use / as a directory separator. This generally saves you th

Re: Python script not working on windows 7 but works fine on linux

2013-03-04 Thread io
Thanks, btw ...i'm the IT guy! I was missing the double slash as dougas suggested!++Thanks anyway. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python script not working on windows 7 but works fine on linux

2013-03-04 Thread io
Genius! The code i posted was an example. My real code was c:\btc_trading i was just missing the double slashes! Thanks , thankyou very much. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python script not working on windows 7 but works fine on linux

2013-03-04 Thread Wolfgang Strobl
io : >The following scripts are working fine on linux but, using the same >version, can't work on windows because i receive the following message: Thats because there is No such file or directory: '/home/io/btc_trading/ on that Windows PC. -- Wir danken für die Beachtung aller Sicherheitsbest

Re: Python script not working on windows 7 but works fine on linux

2013-03-04 Thread Christian Gollwitzer
Am 04.03.13 20:06, schrieb io: The following scripts are working fine on linux but, using the same version, can't work on windows because i receive the following message: snip f = open("/home/io/btc_trading/markets.csv","wb") Windows error : Traceback (most recent call last): File "C

Re: Python script not working on windows 7 but works fine on linux

2013-03-04 Thread ian douglas
On 03/04/2013 11:06 AM, io wrote: esclusioni_file = open('/home/io/btc_trading/exclusions.txt','r') Windows error : Traceback (most recent call last): File "C:\btc_trading\scripts \import_json_2_csv_from_web_and_exclusions.py", line 10, in f = open("/home/io/btc_trading/markets.csv","w

Python script not working on windows 7 but works fine on linux

2013-03-04 Thread io
The following scripts are working fine on linux but, using the same version, can't work on windows because i receive the following message: Script: import json import urllib import csv url = "http://bitcoincharts.com/t/markets.json"; response = urllib.urlopen(url); data = json.loads(response.r

Re: Read csv file and create a new file

2013-03-04 Thread io
What you wrote seems interesting but i haven't understood. Can you explain in simple words considering i'm italian and i'm not understanding so well some terms you use. Sorry, i'm sure you are suggesting something really valid but can't understand it. Marco. -- http://mail.python.org/mailman/li

Re: [Python-ideas] string.format() default variable assignment

2013-03-04 Thread Dave Angel
On 03/04/2013 11:15 AM, David Robinow wrote: Crap. I just forgot to do what I just said I would do and didn't go through my "inconvenient" sequence. Sorry, Steven. It was unintentional. FWIW, you don't have to bother moving the python-list address to a To: field. Just remove the personal add

How to Nest Structs?

2013-03-04 Thread Ari King
Hi, I'm trying to nest the "info_header", "info_body", and "info_trailer" structs (see below) into a "data_packet" struct. Does anyone know how I can/should accomplish this? Thanks. batch_header_format = struct.Struct('!c2h') info_header_format = struct.Struct('!2hl') mkt_status_format = struct

Re: Embedding a for inside an html template for substitution

2013-03-04 Thread Ferrous Cranus
Τη Δευτέρα, 4 Μαρτίου 2013 5:59:34 μ.μ. UTC+2, ο χρήστης Michael Torrie έγραψε: > On 03/04/2013 08:14 AM, Ferrous Cranus wrote: > > > Instead of writing the above html data inside my html template how > > > would i write it with a for that then will be substituted by the > > > python script? >

Re: Question on for loop

2013-03-04 Thread Ricardo Aráoz
El 04/03/13 09:18, newtopython escribió: Hi all, I'm super new to python, just fyi. In the piece of code below, secretWord is a string and lettersGuessed is a list. I'm trying to find out if ALL the characters of secretWord are included in lettersGuessed, even if there are additional values i

Re: i need help

2013-03-04 Thread Alister
On Mon, 04 Mar 2013 07:07:53 -0800, Bryan Devaney wrote: > On Sunday, March 3, 2013 6:45:26 PM UTC, Kwpolska wrote: >> On Sun, Mar 3, 2013 at 7:46 AM, Michael Torrie >> wrote: >> >> > On 02/21/2013 03:18 AM, leonardo wrote: >> >> >> thanks, problem solved >> >> >> > >> > Apparently not. The

Re: i need help

2013-03-04 Thread Ian Kelly
On Mon, Mar 4, 2013 at 8:07 AM, Bryan Devaney wrote: > On Sunday, March 3, 2013 6:45:26 PM UTC, Kwpolska wrote: >> >> It is! How else could he type those two question marks and 10 double-quotes? >> > > Onscreen Keyboard? Or voice recognition, perhaps. We have no idea what the OP's actual input

Re: Question on for loop

2013-03-04 Thread Ian Kelly
On Mon, Mar 4, 2013 at 7:34 AM, Bryan Devaney wrote: >> if character not in lettersGuessed: >> >> return True >> >> return False > > assuming a function is being used to pass each letter of the letters guessed > inside a loop itself that only continues checking if true is returned

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-03-04 Thread Grant Edwards
On 2013-02-28, kramer65 wrote: > I'm using Python for a while now and I love it. There is just one > thing I cannot understand. There are compilers for languages like C > and C++. why is it impossible to create a compiler that can compile > Python code to machinecode? The main issue is that pyth

Re: [Python-ideas] string.format() default variable assignment

2013-03-04 Thread David Robinow
Crap. I just forgot to do what I just said I would do and didn't go through my "inconvenient" sequence. Sorry, Steven. It was unintentional. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-ideas] string.format() default variable assignment

2013-03-04 Thread David Robinow
Ignoring my own posting ban, since I've clearly been misunderstood .. On Sat, Mar 2, 2013 at 10:21 PM, Steven D'Aprano wrote: > On Sat, 02 Mar 2013 21:11:04 -0500, David Robinow wrote: > >> Do you consider it rude that you choose to use a newsreader, thus >> inconveniencing those of us who use th

Re: Embedding a for inside an html template for substitution

2013-03-04 Thread Michael Torrie
On 03/04/2013 08:14 AM, Ferrous Cranus wrote: > Instead of writing the above html data inside my html template how > would i write it with a for that then will be substituted by the > python script? What templating system are you using? Django's? > can you please write an example for me that use

Re: Question on for loop

2013-03-04 Thread Rick Johnson
On Monday, March 4, 2013 6:18:20 AM UTC-6, newtopython wrote: [Note: Post has be logically re-arranged for your comprehensive pleasures] > for character in secretWord: > if character not in lettersGuessed: > return True > return False > > What this code is doing is only checking

Re: Different behavior with multiprocessing

2013-03-04 Thread Chris Angelico
On Tue, Mar 5, 2013 at 2:35 AM, Tomas Kotal wrote: > Seems like I found the problem: os._exit probably takes as parametr unsigned > char, so it uses as error code whatever value it gets modulo 256: > > os._exit(1) # process.exitcode == 1 > os._exit(255) # process.exitcode == 255 > os._exit(256)

Re: Different behavior with multiprocessing

2013-03-04 Thread Tomas Kotal
Dne pondělí, 4. března 2013 15:31:41 UTC+1 Tomas Kotal napsal(a): > Hi all. > > > > Recently I discovered a strange behavior with multiprocessing library and > call to function os.system (a different behavior under Linux and Windows to > be more specific). I have this simple testing script: >

Re: Different behavior with multiprocessing

2013-03-04 Thread Tomas Kotal
> Under Unix, the return value from os.system() encodes more than one > > piece of information: > > > > http://docs.python.org/2/library/os.html#os.system > > http://docs.python.org/2/library/os.html#os.wait > > > > 32512 is 127*256, meaning that the shell exited with return code 127 > > w

fixed broken links for the latest pylint/astng release

2013-03-04 Thread Sylvain Thénault
Hi there, last week I announced the latest and greatest pylint/astng release but didn't noticed at that time that the download links on our web site were broken, and that the upload to pypi failed. This is now fixed, for those who tried during the mean time. Sorry for the convenience, -- Sylv

Embedding a for inside an html template for substitution

2013-03-04 Thread Ferrous Cranus
Hello pythonistas! I'am tryign to populate a table with dictionary keys and values: Foe that iam using an html template and the questions is what i should write inside 'files.html' so then then the python script populate the table. SuperHost - Economy Χώρος στο δίσκο: 1 GB

Re: i need help

2013-03-04 Thread Bryan Devaney
On Sunday, March 3, 2013 6:45:26 PM UTC, Kwpolska wrote: > On Sun, Mar 3, 2013 at 7:46 AM, Michael Torrie wrote: > > > On 02/21/2013 03:18 AM, leonardo wrote: > > >> thanks, problem solved > > > > > > Apparently not. The shift key on your keyboard still seems to be > > > non-functional. ;) >

Re: Different behavior with multiprocessing

2013-03-04 Thread Chris Angelico
On Tue, Mar 5, 2013 at 1:31 AM, Tomas Kotal wrote: > But when I run same script on Linux, what I get is this: > > 0 > 32512 Under Unix, the return value from os.system() encodes more than one piece of information: http://docs.python.org/2/library/os.html#os.system http://docs.python.org/2/librar

Different behavior with multiprocessing

2013-03-04 Thread Tomas Kotal
Hi all. Recently I discovered a strange behavior with multiprocessing library and call to function os.system (a different behavior under Linux and Windows to be more specific). I have this simple testing script: import sys import os from multiprocess

Re: Question on for loop

2013-03-04 Thread Bryan Devaney
> if character not in lettersGuessed: > > return True > > return False assuming a function is being used to pass each letter of the letters guessed inside a loop itself that only continues checking if true is returned, then that could work. It is however more work than is need

Re: Encoding problem in python

2013-03-04 Thread Vlastimil Brom
2013/3/4 : > I have a problem with encoding in python 27 shell. > > when i write this in the python shell: > > w=u'العربى' > > It gives me the following error: > > Unsupported characters in input > > any help? > -- > http://mail.python.org/mailman/listinfo/python-list Hi, I guess, you are using

Re: Question on for loop

2013-03-04 Thread Dave Angel
On 03/04/2013 07:18 AM, newtopython wrote: Hi all, I'm super new to python, just fyi. Welcome to the Python list. In the piece of code below, secretWord is a string and lettersGuessed is a list. I'm trying to find out if ALL the characters of secretWord are included in lettersGuessed, eve

Re: Python SUDS issue

2013-03-04 Thread Joel Goldstick
On Mon, Mar 4, 2013 at 5:37 AM, VGNU Linux wrote: > Hi Guys, > I am pretty new to web services. > After some googling found that python suds is a suitable module to create > web service client. I am trying to create a client but its giving me an > error which is quite confusing for me. > > Here i

Re: Question on for loop

2013-03-04 Thread Joel Goldstick
On Mon, Mar 4, 2013 at 7:18 AM, newtopython wrote: > Hi all, > > I'm super new to python, just fyi. > Welcome. Next time write a better subject line, and be sure the code you post is actually the code you are running. Provide the results you want and what you get. Provide the traceback if the

Re: Question on for loop

2013-03-04 Thread leo kirotawa
In fact this code is already doing what you want, but if the second character, by example, is not in secrectWord it'll jump out of the for and return. If you want that interact through the all characters and maybe count how many them are in the secrectWord, just take of the return there or do some

Question on for loop

2013-03-04 Thread newtopython
Hi all, I'm super new to python, just fyi. In the piece of code below, secretWord is a string and lettersGuessed is a list. I'm trying to find out if ALL the characters of secretWord are included in lettersGuessed, even if there are additional values in the lettersGuessed list that aren't in s

Python SUDS issue

2013-03-04 Thread VGNU Linux
Hi Guys, I am pretty new to web services. After some googling found that python suds is a suitable module to create web service client. I am trying to create a client but its giving me an error which is quite confusing for me. Here is my code: from suds.client import Client wsdlurl = 'https://46.5

Re: Encoding problem in python

2013-03-04 Thread Steven D'Aprano
On Mon, 04 Mar 2013 01:37:42 -0800, yomnasalah91 wrote: > I have a problem with encoding in python 27 shell. > > when i write this in the python shell: > > w=u'العربى' > > It gives me the following error: > > Unsupported characters in input > > any help? Firstly, please show the COMPLETE err

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-04 Thread Ulrich Eckhardt
Am 01.03.2013 17:28, schrieb Isaac Won: What I really want to get from this code is m1 as I told. For this purpose, for instance, values of fpsd upto second loop and that from third loop should be same, but they are not. Actually it is my main question. You are not helping yourself... In any

Re: Encoding problem in python

2013-03-04 Thread Laszlo Nagy
On 2013-03-04 10:37, yomnasala...@gmail.com wrote: I have a problem with encoding in python 27 shell. when i write this in the python shell: w=u'العربى' It gives me the following error: Unsupported characters in input any help? Maybe it is not Python related. Did you get an exception? Can yo

Encoding problem in python

2013-03-04 Thread yomnasalah91
I have a problem with encoding in python 27 shell. when i write this in the python shell: w=u'العربى' It gives me the following error: Unsupported characters in input any help? -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] PyLint 0.27 / logilab-astng 0.24.2

2013-03-04 Thread Sylvain Thénault
On 01 mars 07:41, Melton Low (devl) wrote: > Hi Sylvain, Hi, > Clicking on the download linked from [1] below gives me an error. > Same with logilab-astng link [2]. > > Not Found > > The requested URL /pub/pylint/pylint-0.27.0.tar.gz was not found on > this server. > > Apache/2.2.16 (Debian)