Re: Multiplication

2024-04-01 Thread Joel Goldstick via Python-list
; a = 2 > > b = 3 > > print( a * b ) > > I guess the operator "*" can be imported from any module... :-) > > bye, > > -- > > piergiorgio > > -- > https://mail.python.org/mailman/listinfo/python-list >>> a = 3 >>> b = 5 >>> print(a*b) 15 >>> No import is necessary. -- Joel Goldstick -- https://mail.python.org/mailman/listinfo/python-list

Re: ModuleNotFoundError

2022-06-17 Thread Joel Goldstick
rsion_info) and executable: > >> > > Unable to initialize device PRN > >> > > >> > That's the command-line "print" program. You need to first start the > >> > Python shell via python.exe. The prompt should change to ">>> ". Then > >> > run print(sys.version) and print(sys.executable). > >> > > >> -- > >> https://mail.python.org/mailman/listinfo/python-list > >> > > > -- > https://mail.python.org/mailman/listinfo/python-list sys is a module that is part of 'batteries included' in python. Since it is not part of the language per se, you need to import it -- Joel Goldstick -- https://mail.python.org/mailman/listinfo/python-list

Re: How to replace characters in a string?

2022-06-08 Thread Joel Goldstick
27;string with starting smart quote" >>> repr(str1) "'’string with starting smart quote'" >>> repr(new_str) '"\'string with starting smart quote"' >>> As you can see, str1 doesn't change, but when you 'replace' on it, the result you want is returned to new_str -- Joel Goldstick -- https://mail.python.org/mailman/listinfo/python-list

Re: Comparing sequences with range objects

2022-04-07 Thread Joel Goldstick
oon Pardon. > -- > https://mail.python.org/mailman/listinfo/python-list I'm not sure I understand what you are trying to do, but if your data has no order, you can use set to remove the duplicates -- Joel Goldstick -- https://mail.python.org/mailman/listinfo/python-list

Re: All permutations from 2 lists

2022-03-02 Thread Joel Goldstick
. > > > > Alternatively, if you expect an empty list to imply some single default > > the the experession: > > > > the_list or (the_default,) > > > > might be of use. > > I've solved the issue. > -- > https://mail.python.org/mailman/listinfo/python-list Would you be so kind as to show the results of your solution? -- Joel Goldstick -- https://mail.python.org/mailman/listinfo/python-list

Re: All permutations from 2 lists

2022-03-02 Thread Joel Goldstick
On Wed, Mar 2, 2022 at 9:01 AM Larry Martell wrote: > > On Wed, Mar 2, 2022 at 8:54 AM Joel Goldstick > wrote: > > > > On Wed, Mar 2, 2022 at 8:46 AM Larry Martell > > wrote: > > > > > > On Wed, Mar 2, 2022 at 8:37 AM Antoon Pardon wrote: > >

Re: All permutations from 2 lists

2022-03-02 Thread Joel Goldstick
he result seems to be an empty list, > > which IMO is a perfectly valid result. > > > > All possible permutations over two collections where one collection is > > empty, should IMO give you an empty collection. > > If one list is empty I want just the other list. Wha

Re: Problem with python

2021-09-04 Thread Joel Goldstick
^ > SyntaxError: invalid syntax > >>> > [/code] > > What is the proper way to fix this? > > Thank you. > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick -- https://mail.python.org/mailman/listinfo/python-list

Re: Regarding inability of Python Module Winsound to produce beep in decimal frequency

2021-08-15 Thread Joel Goldstick
ot me curious, and I found this article. The code is very similar to the pyaudio version a few responses back. https://thehackerdiary.wordpress.com/2017/06/09/it-is-ridiculously-easy-to-generate-any-audio-signal-using-python/ except it doesn't need pyaudio I run Ubuntu 20.04, and I had problems getting pyaudio on my machine. -- Joel Goldstick -- https://mail.python.org/mailman/listinfo/python-list

Re: Python language packages isn't working in Visual Studio Code

2021-05-03 Thread Joel Goldstick
picture of my laptop screen too. > > Waiting for your reply > > Regards Osmany > > -- > > https://mail.python.org/mailman/listinfo/python-list > > > -- > https://mail.python.org/mailman/listinfo/python-list Better yet, cut and paste your relevant text in your email

Re: How to loop over a text file (to remove tags and normalize) using Python

2021-03-10 Thread Joel Goldstick
On Tue, Mar 9, 2021 at 10:36 PM S Monzur wrote: > > Thanks! I ended up using beautiful soup to remove the html tags and create > three lists (titles of article, publications dates, main body) but am still > facing a problem where the list is not properly storing the main body. > There is something

Re: Python cannot count apparently

2021-02-07 Thread Joel Goldstick
le, or the default python interactive console? If you did, please do that again, and copy and paste your code and the results here. There is something amiss. -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: What might cause my sample program to forget that already imported datetime?

2020-10-12 Thread Joel Goldstick
iteTimeDate POSIX > Samplea.py", line 38, in > dto = datetime.datetime.strptime(d1, '%Y-%m-%d %H:%M:%S.%f') > AttributeError: type object 'datetime.datetime' has no attribute 'datetime' > """ > This code will be copied into another program as a function and the presence &g

Re: Use of a variable in parent loop

2020-09-26 Thread Joel Goldstick
hon works fine, the variable name is used > outside of the if block even it has been declared inside. > > This does not look right to me. Can we change this behavior or is there > any point to keep it this way ? > -- > https://mail.python.org/mailman/listinfo/python-list

Re: About float/double type number in range.

2020-08-26 Thread Joel Goldstick
gt;[2][IMG] Virus-free. [3]www.avg.com > > References > >Visible links >1. https://go.microsoft.com/fwlink/?LinkId=550986 >2. > http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient >

Re: How to remove "" from starting of a string if provided by the user

2020-08-11 Thread Joel Goldstick
rings contain ' (single quote) characters. > > [snip] > > -- > https://mail.python.org/mailman/listinfo/python-list I'm assuming that you don't want the string to start with single quote, doublequote, or the other way around. If you have that situation, strip the first and

Re: I need to study Python

2020-06-26 Thread Joel Goldstick
want to learn python, how can i or where can i study python? > > -- > > https://mail.python.org/mailman/listinfo/python-list > > > -- > https://mail.python.org/mailman/listinfo/python-list start with python.org -- Joel Goldstick http://joelgoldstick.com/blog http://cc

Re: Strings: double versus single quotes

2020-05-19 Thread Joel Goldstick
ht triple quotes are for docstrings? > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Cartopy error

2020-05-12 Thread Joel Goldstick
ROJ4_VERSION, > ImportError: libproj.so.19: cannot open shared object file: No such file > or directory > > > Thank you, > > > Conrado > > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Strong AI Steps for Coding AI Mind in Python

2020-04-14 Thread Joel Goldstick
sticated algorithm for free will in robots. If you have no robot and > you are building a creature of pure reason, nevertheless include a Volition > stub for the sake of AI-Complete design patterns. > > > 33. The SeCurity module. > > The SeCurity module is not a natural com

Re: How to get a place's longitude and latitude?

2020-02-24 Thread Joel Goldstick
python-list > > > -- > https://mail.python.org/mailman/listinfo/python-list I found this article for using a raspberry pi and a gps card. It might give you some ideas: https://tutorials-raspberrypi.com/build-raspberry-pi-gps-location-navigation-device/ -- Joel Goldstick http://joelgoldsti

Re: ERROR in loading data

2020-02-04 Thread Joel Goldstick
) = '/content/gdrive/My > Drive/3_Classes/'.loads_data() > 3 trainX = trainX.astype("float") / 255.0 > 4 testX = testX.astype("float") / 255.0 > 5 > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: installation issue.

2020-01-20 Thread Joel Goldstick
ities. > > Regards, > Sandesh Kamble > > > Sent from Mail for Windows 10 > > -- > https://mail.python.org/mailman/listinfo/python-list if you are typing something like this: cd /mydir but you are in the python shell, and not to linux shell copy and paste your screen display

Re: Extract all words between two keywords in .txt file (Python)

2019-12-11 Thread Joel Goldstick
PROC SQL:" This will find the starting index point. It returns and index 3. DO the same for each of the three possible ending strings. Use if/else 4. This will give you your ending index. 5 slice the included string, taking into account the start is start + len("PROC SQL;") an

Re: ImportError: No module named Adafruit_SSD1306 Update

2019-12-05 Thread Joel Goldstick
explanation there, and I have placed the cursor at the > beginning of the first indented line. Moving down 1 line at a time , > each line is at the same position upto line 157 in the authors code . > Then it is closer in to the edge upto line 190, where it goes back out > again. > > What i

Re: Python Resources related with web security

2019-11-26 Thread Joel Goldstick
> -- > https://mail.python.org/mailman/listinfo/python-list I'm thinking this is a troll or a turing machine experiment? -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: python startup failure problem

2019-11-01 Thread Joel Goldstick
em! This is a mailing list where people will help you solve python problems. You need to do your part as well. Photos, or any attachments are removed before your message is sent to list members. Please copy and paste your traceback from when you run your code, and describe the problems you ar

Re: TypeError: unhashable type: 'list'

2019-10-23 Thread Joel Goldstick
), pattern, flags] > TypeError: unhashable type: 'list' > > Thanks for any insigths -- > -- > Regards, > Joseph Pareti - Artificial Intelligence consultant > Joseph Pareti's AI Consulting Services > https://www.joepareti54-ai.com/ > cell +49 1520 1600 209 > cell +39 339 797 0644 > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: System error while Installing Python 3.7.4 (64 bit).

2019-10-22 Thread Joel Goldstick
gt; [image: image.png] > > > Thanks and Regards, > S.V.Bhargava Reddy. > -- > https://mail.python.org/mailman/listinfo/python-list Images don't make it through on this mailing list. Try to cut and paste complete error message. What OS -- Joel Goldstick http://joelgoldstick

Re: Convert a scientific notation to decimal number, and still keeping the data format as float64

2019-10-21 Thread Joel Goldstick
> with it. > > > > This is JUST a default display representation. Nothing more. If you > care about how something is displayed, just use a formatting tool. > That's all you need to do. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list

Re: Convert a scientific notation to decimal number, and still keeping the data format as float64

2019-10-20 Thread Joel Goldstick
fronts daily -- No one really knows how anything works under the hood. Think: car, toaster, microwave oven, Facebook algorithms, light bulbs, and on and on -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: a &= b

2019-10-04 Thread Joel Goldstick
On Fri, Oct 4, 2019 at 5:01 AM Hongyi Zhao wrote: > > Hi, > > Could you please give me some more hints on: > > a &= b > > It's very difficult for me to understand. > -- > https://mail.python.org/mailman/listinfo/python-list & is bitwise And. a

Re: phyton

2019-09-10 Thread Joel Goldstick
> > def add_vat(amount, vat_rate): > berekening = amount * (1+vat_rate) > return round(berekening,2) > > print(add_vat(101, 'high')) > -- > https://mail.python.org/mailman/listinfo/python-list These code snippets don't run Can you paste your complete code that runs, with the output you get? -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: issue in handling CSV data

2019-09-07 Thread Joel Goldstick
On Sat, Sep 7, 2019 at 8:28 PM Joel Goldstick wrote: > > On Sat, Sep 7, 2019 at 8:21 PM Sharan Basappa > wrote: > > > > I am trying to read a log file that is in CSV format. > > > > The code snippet is below: > > > > ### &

Re: issue in handling CSV data

2019-09-07 Thread Joel Goldstick
Numpy's astype function. At this stage, I get an error. > > This is the error: > my_data_3 = my_data_2.astype(np.float) > could not convert string to float: " "81 > > As you can see, the string "\t"81 is causing the error. > It seems to be due to char "\t". > > I don't know how to resolve this. > > Thanks for your help. > > -- > https://mail.python.org/mailman/listinfo/python-list how about (strip(my_data_2).astype(np.float)) I haven't used numpy, but if your theory is correct, this will clean up the string -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: How to remove a string from a txt file?

2019-09-04 Thread Joel Goldstick
ader to get a list of words between comma. Print the one you like and join the values on each side of the text you are looking for. Write that to a file Lather, rinse and repeat -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Help needed urgently for running some code!!!!

2019-09-03 Thread Joel Goldstick
od idea. However, you can just import all of the modules you might expect to need, and ignore if they aren't present with a suitable try/except block. Try explaining the bigger picture of what you are trying to do, and maybe you can gain some incite into a better way of proceeding. I'm afraid it looks like you have been cutting and pasting without understanding what your code's design is all about. I could be totally wrong. good luck -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: TypeError: loadtxt() got an unexpected keyword argument 'max_rows'

2019-09-03 Thread Joel Goldstick
copy and pasted traceback. That said I found this:.. versionadded:: 1.14.0 max_rows : int, optional Check your version of loadtxt()? > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Hi how do I import files inside a txt file?

2019-09-02 Thread Joel Goldstick
On Mon, Sep 2, 2019 at 9:21 AM Spencer Du wrote: > > On Monday, 2 September 2019 15:03:52 UTC+2, Joel Goldstick wrote: > > On Mon, Sep 2, 2019 at 8:46 AM Spencer Du wrote: > > > > > > On Monday, 2 September 2019 13:36:06 UTC+2, Pankaj Jangid wro

Re: Hi how do I import files inside a txt file?

2019-09-02 Thread Joel Goldstick
compiles it in order. Since you don't know what you want to import until after you run your program, you can't import those modules. You may be able to run a program to read the module list, then have it output to a new file the code you eventually want to run based on the modules you discovered. That sounds cute in a way, but probably not in a good way. You could also surround import statements with try/except code that will import what it can, and alert you when it can't Can you give us the bigger picture of what you want to accomplish? This might lead to a better solution than the one you are thinking of now -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: How should we use global variables correctly?

2019-08-23 Thread Joel Goldstick
here is > only one function can change its value? > > Cameron Simpson 于2019年8月23日周五 下午3:15写道: > The problem with deciding that only one function can change the value, is that someone else can change the other functions. So, if you are working alone, it won't be a problem, but once

Re: Web framework for static pages

2019-08-13 Thread Joel Goldstick
its own set of features and applications I know well, if a > customer wants a dynamic website with a lot of logic (dynamic pages). > > -Morten > > Blogging at http://blogologue.com > Tweeting at https://twitter.com/blogologue > On Instagram https://instagram.com/morphexx >

Re: Web framework for static pages

2019-08-13 Thread Joel Goldstick
er makers didn't like it. HTML5 seemed to be a big step forward. I used a program called Citydesk a long time ago that I think could do what the op might like. But its long gone. I think django could be used to make static pages quite easily. Its not hard to learn, and in the event your

Re:

2019-06-24 Thread Joel Goldstick
On Mon, Jun 24, 2019 at 4:13 AM Sagar Jape wrote: > > I'm not able to install pip in my pc it gives following error. what should > I do? > -- > https://mail.python.org/mailman/listinfo/python-list Copy and paste your session info. The list doesn't show images.

Re: problem in installing packages

2019-05-28 Thread Joel Goldstick
> > > > -- > https://mail.python.org/mailman/listinfo/python-list It appears you are trying to execute a linux shell command while in the python repl. exit python, and try again -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Question :)

2019-05-13 Thread Joel Goldstick
raries, you will find that using virtualenv keeps the right things in the right places. So after you get started with Django, look into what your problems are with virtualenv. Copy and paste the commands you use to install it, and include the resulting error messages. You will get help here

Re: Losing words

2019-04-01 Thread Joel Goldstick
> > > > Nah mate, > > def text(): > mess = input("> ") > s.send(bytes("PRIVMSG " + " "+ channel + " " + mess + "\n", "UTF-8")) > > text() > Is this a typo or are you calling text() from w

Re: trying to begin a code for web scraping

2019-02-19 Thread Joel Goldstick
Beautiful soup is your friend here. It can analyze the data within the html tags on your scraped page. But often javascript is used on 'modern' web pages so the page is actually not just html, but javascript that changes the html. For this you need another tool -- i think one is calle

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Joel Goldstick
in the python-tutor mailing list. You should also use print function in your loops to learn what is really going on. > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Exercize to understand from three numbers which is more high

2019-01-25 Thread Joel Goldstick
me to fix it?! :\ > > > > ^Bart > -- > https://mail.python.org/mailman/listinfo/python-list This looks like homework. What you are asking could be solved a number of ways. I'm guessing your homework wants you to learn about if/else and comparison operators. A

Re: Type hinting of Python is just a toy ?

2019-01-04 Thread Joel Goldstick
; special type of variable, the "stem". > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list I don't normally comment on this type of thread, but I believe the OP is showing an example of the dunning-kruger effect https://en.wikipedia.org/wiki/Dunning%E2%80%93

Re: how to match list members in py3.x

2018-11-25 Thread Joel Goldstick
On Sun, Nov 25, 2018 at 11:51 AM Muhammad Rizwan wrote: > > On Sunday, 25 November 2018 11:41:56 UTC-5, Joel Goldstick wrote: > > On Sun, Nov 25, 2018 at 11:36 AM Muhammad Rizwan > > <> wrote: > > > > > > IF YOU CAN'T HELP BETTER

Re: how to match list members in py3.x

2018-11-25 Thread Joel Goldstick
e that people here are often very knowledgeable to help with python problems, but as a rule, doing someone's homework isn't something people like to do. On to your problem. You should understand lists and sets, and for loops. Try some code and come back with what you have. Then you will get

Re: Error in installing "pyperclip" module

2018-11-10 Thread Joel Goldstick
vely monitor and help out on the Tutor list. > -- > boB > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Why list.reverse() modifies the list, but name.replace() does not

2018-09-05 Thread Joel Goldstick
? As a beginner, I find this > confusing. How do you do it? > > Thank you! > -- > https://mail.python.org/mailman/listinfo/python-list Learn about help. Go to python command line and type help(L) it will show that this method reverses in place. Type help(name) and it will sho

Re: Why list.reverse() modifies the list, but name.replace() does not modify the string?

2018-09-03 Thread Joel Goldstick
? As a beginner, I find this > confusing. How do you do it? > > Thank you! > -- > https://mail.python.org/mailman/listinfo/python-list Learn about help. Go to python command line and type help(L) it will show that this method reverses in place. Type help(name) and it will show

Re: Help Needed : script weird result.

2018-09-01 Thread Joel Goldstick
er the numbers separated by space and press ENTER :5 90 63 82 59 24 > > 5 > > 5 > > 5 > > 5 > > 5 > > 24 > > Lowest : 24 > > > > Regards > > Mohan C > > > > > Compare, > > >>> min(5, 90, 63, 82, 59, 24)

Re: Connection refused when tryign to run bottle/flask web framweworks

2018-08-21 Thread Joel Goldstick
Wulfraed Dennis Lee Bieber AF6VN > wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/ > > -- > https://mail.python.org/mailman/listinfo/python-list although i don't offer advice too often here, as i am kind of retired., this is extremel

Re: printing to stdout

2018-08-19 Thread Joel Goldstick
On Sun, Aug 19, 2018 at 12:16 PM Richard Lucassen wrote: > > On Sun, 19 Aug 2018 10:11:08 -0400 > Joel Goldstick wrote: > > > > Well, apparently there were quite a lot of things that makes the > > > code more readable I'd say. And even better. But it was in

Re: printing to stdout

2018-08-19 Thread Joel Goldstick
data objects > > -- > richard lucassen > http://contact.xaq.nl/ > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Program to output a subset of the composite numbers

2018-08-15 Thread Joel Goldstick
bers, and you can subtract that sequence from the sequence of positive integers -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: about main()

2018-07-05 Thread Joel Goldstick
#x27; issue that I can see. > > Abdur-Rahmaan Janhangeer > https://github.com/Abdur-rahmaanJ > > * Create as many functions as you can > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseb

Re: Understanding memory location of Python variables

2018-06-16 Thread Joel Goldstick
ttps://mail.python.org/mailman/listinfo/python-list Others can probably give a more complete explanation, but small numbers, and apparently letters are cached since they are so common. -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: stock quotes off the web, py style

2018-05-16 Thread Joel Goldstick
171.13 > week52Low 139.13 > ytdChange -0.0485148849103 > > You would do multiple symbols in a loop which you enter with an open urllib > object, rather than opening a new one for each symbol inside the loop. > > Frederic > > -- > https://mail.python.org/mailman/listinfo/python-list Many people find the library called Requests a better alternative to urllib. It is more intuitive -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax error (?) on ubuntu

2018-05-03 Thread Joel Goldstick
quot;, line 132 > if(PY3K): ID = ID.decode("utf-8") > ^ > TabError: inconsistent use of tabs and spaces in indentation > -- > https://mail.python.org/mailman/listinfo/python-list Check to see if you have a tab after the colon in the last line. You must u

Re: Looking for advice

2018-04-20 Thread Joel Goldstick
//mail.python.org/mailman/listinfo/python-list sqlite is a small, in memory db that comes standard with python (i'm pretty sure). Great place to start -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: for info

2018-01-31 Thread Joel Goldstick
On Wed, Jan 31, 2018 at 10:55 AM, wrote: > from where we learn python for free of cost. i am begineer in python.plzz > help me > -- > https://mail.python.org/mailman/listinfo/python-list > Start with python.org tutorial pages -- Joel Goldstick http://joelgoldstick.com

Re: How to use a regexp here

2017-12-08 Thread Joel Goldstick
f the line, since 'in' would still be true no matter where the desired string is placed. It would be useful to see some sample data of the old data, and the new data -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Python script

2017-12-07 Thread Joel Goldstick
y will help you figure out what you don't understand -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: we want python software

2017-12-05 Thread Joel Goldstick
indows 10 > > > > -- > > https://mail.python.org/mailman/listinfo/python-list > -- > https://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: How to use a regexp here

2017-12-04 Thread Joel Goldstick
f the line, since 'in' would still be true no matter where the desired string is placed. It would be useful to see some sample data of the old data, and the new data -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Boolean Expressions

2017-09-28 Thread Joel Goldstick
als to 3 right ? > which > > >equals the right hand side , hence first term is True > > > > But the test is for "!=", not "==". So False. > > > > Cheers, > > Cameron Simpson (formerly c...@zip.com.au) > > Right ... I didn't see the ' =! ' > -- > You didn't see the '!=' -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: A small quiz question

2017-08-16 Thread Joel Goldstick
ef f(i): print(i); return i; > > f(4)**f(1)**f(2) > > > -- > https://mail.python.org/mailman/listinfo/python-list > That's a nice problem for order evaluation. I guessed wrong. -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Redirecting input of IDLE window

2017-08-14 Thread Joel Goldstick
rn more. It displays information like help does in a python environment, but you can also redirect it to a file -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Need python script to get last 6 month's monthly billing

2017-08-08 Thread Joel Goldstick
s://mail.python.org/mailman/listinfo/python-list > You haven't asked a question. It is doubtful someone here would write code for you. In any case your problem isn't well stated. Why don't you show the code you have written, and explain where it fails? -- Joel Golds

Re: In which order many functions are executed in a python code

2017-06-09 Thread Joel Goldstick
pposite, for instance, some parameters or outputs from the second function >> are called in the first one even thou they are not global, any hints ? >> > Maybe if you post some specific code it will be easier to see what Functions are run in the order in which they are called

Re: I need help with making my claculator

2017-05-20 Thread Joel Goldstick
webpage before answering: > > http://sscce.org/ > > It is written for Java programmers, but it applies to Python too. > > Thank you. > > > > -- > Steve > Emoji: a small, fuzzy, indistinct picture used to replace a clear and > perfectly comprehensible word.

Re: I have a encountered a new problem.

2017-05-01 Thread Joel Goldstick
te the traceback -- most people (all?) won't see the image you added here -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Bigotry and hate speech on the python mailing list

2017-04-18 Thread Joel Goldstick
y on topic. > > Isn't this list content moderated by anyone? > > -Jim > Plus 1 to Jim. Come on gang! Back to python! Spaces vs. tabs anyone? -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Quick questions about globals and database connections

2017-04-05 Thread Joel Goldstick
e') >> 17 updatedb('postgres') >> 18 >> 19 if __name__ == "__main__": >> 20 main() >> - >> >> > > -- > https://mail.python.org/mailman/listinfo/python-list You may have an indentation problem that isn't apparent in your code pasted here. Are you sure that dbconnect always returns something? -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Joel Goldstick
ng at all and it still > produces > ProgrammingError(1064, "You have an error in your SQL syntax; check the > manual that corresponds to your MariaDB server version for the right syntax > to use near '(pagesID, host, ref, location, useros, browser, visits) VALUES > (1, 'cyta.gr', '' at line 1") > > I think that Ian Kelly is right and it has soemthign to do with the databse > wrapper not substituting properly the actual string contain in the LIKE > clause between the double quotes. > > Perhaps i need to change pymysql with some other database interface or there > is something other than that? > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: PEOPLE! PLEASE! [ WAS: Re: Who are the "spacists"? ]

2017-03-25 Thread Joel Goldstick
worth the name, makes it a non issue (since it can > convert between one and the other, Eclipse/LiClipse comes to mind). Get > real, and think before you post/send! > > -- > Gilmeh > -- > https://mail.python.org/mailman/listinfo/python-list +1 -- Joel Goldstick http://

Re: Who are the "spacists"?

2017-03-20 Thread Joel Goldstick
first to post that this topic would go nowhere. 77 posts later, for some reason the word 'spaceist' bothers me. Why do people debate spaces versus tabs? I don't think it has to do with spaces or tabs, but something more sociological or psychological. -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Who are the "spacists"?

2017-03-17 Thread Joel Goldstick
ndentation, > did such attemps take place? > -- > https://mail.python.org/mailman/listinfo/python-list This is not a useful conversation. It has been had over and over in the past. Some people like tabs, some like spaces. In python you can use either, but you must stick to one

Re: Problems with scripts

2017-02-13 Thread Joel Goldstick
t that price? ") > while price or how_many != "done": > total_price = int(total_price) + int(price) > total_items = int(total_items) + int(how_many) > item_num = item_num + 1 > price = input("What is the price of item number " + str(item_num) + &

Re: Clickable hyperlinks

2017-01-09 Thread Joel Goldstick
ough you pressed on > with certain lines of comment, especially when it was pointed out that > your question came from the wrong premise and idea of what the "console" > is. I don't believe that someone pointing out flaws in your > understanding is inherently rude, th

Re: Help with this code

2017-01-09 Thread Joel Goldstick
ython.org/mailman/listinfo/python-list I was confused whether the OP wanted to retain the list order. The spec seemed unclear. If not, this is a nice approach. Of course this also removes duplicate values. -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-31 Thread Joel Goldstick
while, einstein, you will see that the group will wander off into (sometimes) interesting asides when the original question seems to have been played out. Its a form a creative ignoring. -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mai

Re: learning and experimenting python.

2016-12-31 Thread Joel Goldstick
tten backwards so that it appears normal in a rear view mirror. Do they do that in other countries? > -- > Wulfraed Dennis Lee Bieber AF6VN > wlfr...@ix.netcom.com HTTP://wlfraed.home.netcom.com/ > > -- > https://mail.python.org/mailman/listinfo/p

Re: List comprehension

2016-12-30 Thread Joel Goldstick
ed: >>[(1, 2), (3, 4)] > > You can try [(x,z) for x,z in data]. > In your situation a takes the values (1,2) or (3,4) in the one that I put x > and z take the tupple values (x first one z second one). > >>>> [(x,z) for x,z in data] > [(1, 2), (3, 4)] I like yours bett

Re: List comprehension

2016-12-30 Thread Joel Goldstick
: > [(1, 2), (3, 4)] > -- > https://mail.python.org/mailman/listinfo/python-list Thy this: >>> [(a[0], a[1]) for a in data] [(1, 2), (3, 4)] -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode script

2016-12-15 Thread Joel Goldstick
things could be worse.” So I cheered up, and sure > enough, things got worse. > > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: NameError

2016-11-23 Thread Joel Goldstick
; is not defined > > How to solve this error ? > -- > https://mail.python.org/mailman/listinfo/python-list have you imported pygame? -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Python does not start

2016-11-17 Thread Joel Goldstick
t python. Can you be a bit more forthcoming about your issue? -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Python -Simplebool

2016-10-05 Thread Joel Goldstick
=open('mutation_result.csv','w') > if INPUT['equi_steps'] == 0: #direct mutation > output.writelines('MutNodes,MutStates,%s\n'%(','.join(INPUT['observe_list']))) > for mute_pair in mut_list: > nodes=[] > states=[] > for node,state in mute_pair: > nodes.append(node) > states.append(str(state)) > output.writelines('%s,%s,%s\n'%('/'.join(nodes),'/'.join(states),','.join(mut_result[mute_pair]))) > elif INPUT['equi_steps'] > 0: #mutation with pre-equilibration steps > out_list=[] > for node in INPUT['observe_list']: > out_list.append(node) > out_list.append(node+'(mut)') > output.writelines('MutNodes,MutStates,%s\n'%(','.join(out_list))) > for mute_pair in mut_list: > nodes=[] > states=[] > for node,state in mute_pair: > nodes.append(node) > states.append(str(state)) > result_list=[each_result for each_pair in mut_result[mute_pair] for > each_result in each_pair] # collapse results > output.writelines('%s,%s,%s\n'%('/'.join(nodes),'/'.join(states),','.join(result_list))) > output.close() > > def GenerateCombinations(INPUT): > StrBool={'True':True,'False':False} > NodeState=[] > Combine=[] > for node_list in INPUT['mutation_list']: > for node in open(node_list): > NodeState.append((node.strip(),StrBool[INPUT['keep_state'][INPUT['mutation_list'].index(node_list)]])) > if INPUT['mutation_mode']=='single': > for mute_state in NodeState: > Combine.append((mute_state,)) > return Combine > elif INPUT['mutation_mode']=='double': > for i in range(len(NodeState)): > for j in range(i+1,len(NodeState)): > if NodeState[i][0] != NodeState[j][0]: > Combine.append((NodeState[i],NodeState[j])) > print 'Total %s combinations.'%(len(Combine)) > return Combine > if __name__ == '__main__': > try: > para=ParaParser(sys.argv[1]) > except: > para=ParaParser('mutation.in') > simu_mutation(para) > > > After running this file, I got the following > error:/home/JPJ/Priya_Ph.D/simple_bool/simplebool/SimpleBool-master/BoolMutation.py > in () > 383 para=ParaParser(sys.argv[1]) > 384 except: > --> 385 para=ParaParser('mutation.in') > 386 simu_mutation(para) > > /home/JPJ/Priya_Ph.D/simple_bool/simplebool/SimpleBool-master/BoolMutation.py > in ParaParser(ParaFile) > 254 } # define parameters > 255 > --> 256 for each_line in open(ParaFile).readlines(): > 257 para_name = each_line.split('=')[0].strip() > 258 para_value = each_line.split('=')[1].strip() > > IOError: [Errno 2] No such file or directory: 'mutation.in' > > > I can't understand, the problem here. Should I specify anything in the > Boolmutation.py file. Any help would be appreciated > Thank you > Regards > Priya > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Is duck-typing misnamed?

2016-08-27 Thread Joel Goldstick
r > sounding or acting), and can still suffer socially for such reasons, this it > not funny to me. We should stick with ducks. > > -- > Terry Jan Reedy > > -- > https://mail.python.org/mailman/listinfo/python-list which ducks? -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Print Error

2016-07-28 Thread Joel Goldstick
hon 3.x. print is a function. Use print("this line will be printed") -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Why not allow empty code blocks?

2016-07-24 Thread Joel Goldstick
cks that >> don't now use 'end' would look odd. I think it would either have to be >> all or nothing. I guess nothing. > > > > > -- > Steven > “Cheer up,” they said, “things could be worse.” So I cheered up, and sure > enough, things got worse. > This thread is beginning to feel like a dog whistle for people who like braces. I've been python coding since 2009 I think, and I think I have used pass less than a handful of times. ... and except for sets and dicts, I can't remember using a { -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Appending an asterisk to the end of each line

2016-07-05 Thread Joel Goldstick
", it then renames it to > "win.txt", so "win_new.txt" shouldn't exist. > > Of course, if there's already a file called "win_old.txt", then the first > rename will raise an exception, and you'll have "win_new.txt" and the > original "win.txt". > > -- > https://mail.python.org/mailman/listinfo/python-list Why don't you comment out the renames, and see what happens? -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list

Re: Appending an asterisk to the end of each line

2016-07-05 Thread Joel Goldstick
On Tue, Jul 5, 2016 at 6:29 PM, Seymore4Head wrote: > On Tue, 5 Jul 2016 18:27:25 -0400, Joel Goldstick > wrote: > >>On Tue, Jul 5, 2016 at 6:05 PM, Seymore4Head >> wrote: >>> import os >>> >>> f_in = open('win.txt', 'r'

  1   2   3   4   5   6   7   8   >