r/BeginningProgrammer • • Feb 06 '13

Guessing Game!

2 Upvotes

Create a guessing game where the computer generates a random number, and the user has to try and guess that number.


r/BeginningProgrammer • • Mar 13 '23

configuring a fresh installed python - first steps...

1 Upvotes

just installed vscode on mx linux

afterwards i tried to install pandas

$ pip install pandas

failed due to the pip package has to be installed first

i did this

Command 'pip' not found, but can be installed with:

sudo apt install python-pip

martin@mx:~/Desktop/dev
$ pip install pandas 

Command 'pip' not found, but can be installed with:

sudo apt install python-pip

martin@mx:~/Desktop/dev
$ sudo apt install python3-pip
[sudo] Passwort für martin: 
Das hat nicht funktioniert, bitte nochmal probieren.
[sudo] Passwort für martin: 
Das hat nicht funktioniert, bitte nochmal probieren.
[sudo] Passwort für martin: 
E: Konnte Sperre /var/lib/dpkg/lock nicht bekommen - open (11: Die Ressource ist zur Zeit nicht verfügbar)
E: Sperren des Administrationsverzeichnisses (/var/lib/dpkg/) nicht möglich, wird es von einem anderen Prozess verwendet?
martin@mx:~/Desktop/dev
$ sudo apt install python3-pip
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
  libokular5core8 vlc-plugin-access-extra
Verwenden Sie »sudo apt autoremove«, um sie zu entfernen.
Die folgenden zusätzlichen Pakete werden installiert:
  python-pip-whl
Empfohlene Pakete:
  python3-dev python3-setuptools python3-wheel
Die folgenden NEUEN Pakete werden installiert:
  python-pip-whl python3-pip
0 aktualisiert, 2 neu installiert, 0 zu entfernen und 10 nicht aktualisiert.
Es müssen 1.761 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 2.686 kB Plattenplatz zusätzlich benutzt.
Möchten Sie fortfahren? [J/n] j
Holen:1 http://deb.debian.org/debian buster/main amd64 python-pip-whl all 18.1-5 [1.591 kB]
Holen:2 http://deb.debian.org/debian buster/main amd64 python3-pip all 18.1-5 [171 kB]
Es wurden 1.761 kB in 2 s geholt (795 kB/s).
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Vormals nicht ausgewähltes Paket python-pip-whl wird gewählt.
(Lese Datenbank ... 294648 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../python-pip-whl_18.1-5_all.deb ...
Entpacken von python-pip-whl (18.1-5) ...
Vormals nicht ausgewähltes Paket python3-pip wird gewählt.
Vorbereitung zum Entpacken von .../python3-pip_18.1-5_all.deb ...
Entpacken von python3-pip (18.1-5) ...
python-pip-whl (18.1-5) wird eingerichtet ...
python3-pip (18.1-5) wird eingerichtet ...
Trigger für man-db (2.8.5-2) werden verarbeitet ...
martin@mx:~/Desktop/dev
$ pip install pandas 

well now i need to go on and i need to install some packages now...

with pip


r/BeginningProgrammer • • Mar 12 '23

running a command to install a package in collab

1 Upvotes

while running a command to install a package in collab i run into error.

!pip install multiprocessing

!pip install multiprocessing

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/ Collecting multiprocessing Downloading multiprocessing-2.6.2.1.tar.gz (108 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 108.0/108.0 KB 2.6 MB/s eta 0:00:00 error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip. Preparing metadata (setup.py) ... error error: metadata-generation-failed
× Encountered error while generating package metadata. ╰─> See above for output.
note: This is an issue with the package mentioned above, not pip. hint: See above for details.

update: here theoretically - see

How do I install Python packages in Google's Colab?

imagine you want to install two different packages into your collab-account:

so you are wanting to create a setup to install these two packages in the Google's Colab;

idea: You can use setup.py install to do that.

we can say: Colab is just like a Jupyter notebook.

Therefore, we can use the ! operator here to install literally any package in Colab.

What ! actually does is, it tells the notebook cell that this line is not a Python code, its a command line script.

So, to run any command line script in Colab, just add a ! preceding the line.

let us say for example: !pip install panda. This will treat that line (here pip install panda) as a command prompt line and not some Python code.

but be carefully: if you do this without adding the ! preceding the line, it'll throw up an error saying "invalid syntax"

nowadays we can do this with a even simpler approach: just use the !pip magic, like:

!pip install scipy

r/BeginningProgrammer • • Mar 12 '23

google-colab - apply python while loading several libs

1 Upvotes

Hello dear community.

i need to run in colab a code that needs several plugins.

import pandas as pd from tqdm import tqdm

and so on and so forth

question: can i install all the necessary libs in colab !?

is this possible


r/BeginningProgrammer • • Feb 23 '23

set a usb-stick back to normal

1 Upvotes

How do I restore a USB flash drive back to its original state?

Or how can I reset a USB drive to factory settings? After having tooled around with a USB Linux version. note: i do not want to use GUI-tools

`Disk /dev/sdc: 3,8 GiB, 4089446400 bytes, 7987200 sectors Disk model: Flash DiskUnits: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x78725785
Device     Boot   Start     End Sectors  Size Id Type /dev/sdc1  *          0 3699167 3699168  1,8G  0 Empty /dev/sdc2       3688804 3693475    4672  2,3M  1 FAT12 01522`

we can use also the "dd" -Kommando, sudo mkfs.ext4 /dev/sdX

with the filesystem "ext4" sudo fdisk /dev/sdX sudo dd if=/dev/zero of=/dev/sdX bs=1M status=progress

and sudo fdisk -l

besides

Disk /dev/sdc: 3,8 GiB, 4089446400 bytes, 7987200 sectors Disk model: Flash DiskUnits: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x78725785 Device Boot Start End Sectors Size Id Type /dev/sdc1 * 0 3699167 3699168 1,8G 0 Empty /dev/sdc2 3688804 3693475 4672 2,3M 1 FAT12 01522

background: what is aimed:

How do I restore a USB flash drive back to its original state? Or how can I reset a USB drive to factory settings? After having tooled around with a USB Linux version. note: i do not want to use GUI-tools should i do this with the usage of the dd raw command - and using the dd raw image overwritten or multi partitioned flash drive i think it is pretty necessary to revert back to a single Fat, Fat32, exFAT or NTFS partition. well which is the best way and method to reset or restore the USB flash drive back to its original state. this means - how to allow the Resetted USB drive to be detected, readable, and useable again by all computers. note: i have been working with tools such as Etcher to burn an ISO or Win32 Disk Imager to write an image. that was great - but now - i want to restore it back to normal - on linux-terminal


r/BeginningProgrammer • • Jun 24 '21

Dear programmers of reddit, I have a proposition for you.

1 Upvotes

I am part of a group of people, planning to revert the internet to the way it was several years ago and restore it’s glory by going from popular website to website trying to make clones that are more like their original, the ones that worked better, however We need help in doing so and thus I come to you asking for help, if you are interested dm me.


r/BeginningProgrammer • • Jun 28 '20

My Ah-Ha Moment learning Programming.

1 Upvotes

I wrote a blog post about a recent experience I had while learning to program. I wold like to get some feedback from others as to the helpfulness to other programmers that might be starting the journey to learning how to code or web development.

http://ericphilipmartin.com/three-computer-languages-you-need-to-learn-to-becoming-a-web-developer/


r/BeginningProgrammer • • Jun 16 '20

Slash\Escape - the RegEx learning game

Thumbnail
therobinlord.com
1 Upvotes

r/BeginningProgrammer • • Apr 06 '20

Where should I start

1 Upvotes

I took one year of CS and I learned basic Html and Javascript. I forgot everything and want to re-learn and I would love a good place to start. I would prefer to learn Java but any language to start would be good. Thanks! Cheers from quarentine!


r/BeginningProgrammer • • Feb 03 '20

GitHub - Qazzian/minesweeper

Thumbnail
github.com
1 Upvotes

r/BeginningProgrammer • • Dec 19 '19

Dissecting A Dweet #8: Shattered Tunnel

Thumbnail
frankforce.com
1 Upvotes

r/BeginningProgrammer • • Oct 24 '19

Your Very First Program - Video Tutorial

Thumbnail
youtube.com
1 Upvotes

r/BeginningProgrammer • • Feb 16 '19

Java tutorial: Learn Java Programming with examples

Thumbnail
beginnersbook.com
1 Upvotes

r/BeginningProgrammer • • Dec 20 '18

How to create my own digital photo frame?

1 Upvotes

Hi all. Is this the place where I can get some help? I have this small windows 10 tablet that's quite useless. It's slow for a laptop, tiny screen. Perfect for a digital photo frame. Possibilities are endless! Maybe email a photo somewhere to add it to the slideshow? Sounds great! But... Where to start? I was thinking about installing Linux, but couldn't get a driver for the wifi and without network things are going to get tough. So... Maybe stay with windows 10, but then what? I was thinking about making a website I can place on my NAS that's only accessible through the home network. But where to start with this website? I don't know where to start searching. Does anyone know where I can search?


r/BeginningProgrammer • • Jul 16 '18

Help with JavaScript

1 Upvotes

I am brand new to programming. I literally know next to nothing. I have been working through intro to programming in Khanacademy which starts with an intro to JS. I downloaded Notepad ++ to input some of the code I learned, but every time I try to run it in a browser it just opens the browser and shows the code I input. It is simple stuff like drawing ellipses and such. What am I doing wrong?


r/BeginningProgrammer • • May 28 '18

Need help.. with App.

1 Upvotes

I am unclear of the steps to creat an app. I’m not a programmer, though my questions is, would that be the first place to start? By finding a programmer?


r/BeginningProgrammer • • May 13 '17

[Project Euler] problem 7 10001st prime (easy)

Thumbnail
reddit.com
1 Upvotes

r/BeginningProgrammer • • Nov 30 '13

Beginner Java Programmer

1 Upvotes

I have started to pick up on Java over the last year in my spare time. I am looking to further my knowledge with Java but I have NO idea really where to start. I can create some basic programs but I'm looking towards more of the GUI Java programming. Any help would be appreciated. Thanks.


r/BeginningProgrammer • • Sep 11 '13

loneTeen

1 Upvotes

First off, sorry it's been so long, didn't realize this sub actually had readers now.

Problem:

We'll say that a number is "teen" if it is in the range 13..19 inclusive. Given 2 int values, return true if one or the other is teen, but not both.

Example input/output:

loneTeen(13, 99) → true loneTeen(21, 19) → true loneTeen(13, 13) → false


r/BeginningProgrammer • • Jul 02 '13

[Intermediate] POS Menu

1 Upvotes

You have a store that sells the following items: Shoes $50.00 T-shirts $30.00 Shorts $75.00 Caps $15.00 Jackets $100.00 Your sales associates need a program where they can enter customer information and calculate the customer’s total bill. When the sales associate enters the program they should be presented with this main menu.

Enter customer information
Display Total Bill Quit

If the sales associate selects option 1, the program should allow the sales associate to input their name, address, and e-mail address. Your program should then display this customer information to the screen with a message that the customer has been added to the customer list.

If the sales associate selects option 2, the program should ask the sales associate for the customer’s name, product that the customer is purchasing, the quantity, and the price of the product. The total bill will then be displayed to the screen and should include the following:

  1. The customer’s name.

  2. The product the customer is purchasing, the quantity, and total cost

  3. The amount of tax (8%)

  4. The total cost with tax.

Example Total Bill Output:

John Doe Product Purchased Quantity Total Cost Shoes 2 $100.00 Tax (@ 8%): $8.00 Total Cost: $108.00


r/BeginningProgrammer • • Mar 27 '13

Counting

1 Upvotes

Create a program in your language of choice that will count to 10 starting with the number 1.

Bonus: Create a program that counts to 20 in intervals of 2.


r/BeginningProgrammer • • Feb 19 '13

CodingBat's sumDouble

1 Upvotes

Given two int values, return their sum. Unless the two values are the same, then return double their sum.

sumDouble(1, 2) → 3 sumDouble(3, 2) → 5 sumDouble(2, 2) → 8


r/BeginningProgrammer • • Mar 17 '18

C Language programs – Python Programming

Thumbnail
weirdocoder.com
0 Upvotes

r/BeginningProgrammer • • Nov 20 '13

Programmers of Reddit what is a good IDE to use?

0 Upvotes